My first problem is, that the template is not found, instead a layer with a default gtemplate is created. Do I have to add a path to the templates?
My second problem is: How can I select a given dataset in order to plot it in my dialog-window. I used the layer icon selection tool as with normal graph-windows, but the datasets selected were not plotted.
As long as the template is on your User path or the program path you don't need to include the path. (If it's in a subfolder you do need the subfolder name.) Adding plots to the graph is best done by script. Here's the approach that I've been using...
DialogName!graph.create(TemplateName); DialogName!GraphPlaceholderName.attach(); doc -e P {%W=%H}; // find name of graph window win -o %W { lay -i Data1_B; // plot Data1_B };