Origin Ver. and Service Release (Select Help-->About Origin): 2017 b9.4.0.220
Operating System:Win10
Hi all,
I have a problem creating a scatter plot with a colormap.
Worksheet wks = Project.ActiveLayer();
DataRange dr;
//Creating XYY Range
dr.Add("X", wks, 0, 2, -1, 2);
dr.Add("Y", wks, 0, 4, -1, 4);
dr.Add("Y", wks, 0, 6, -1, 6);
GraphPage gp;
gp.Create("Origin");
GraphLayer gl = gp.Layers();
gl.AddPlot(dr, IDM_PLOT_INDEX_COLOR); //ID: 247 for Color mapped
This code is my attempt to create a graph that has column 3 as X, column 5 as Y and column 7 as the reference for the color scale.
Instead it just creates a graphpage with columns 5 and 7 as a group and no plot type is selected (so it's just a blank page with axes).
The LabTalk commands I used in this code work as I want them to, execpt that it creates a line plot so I have to use the update_plot_type X-Function.
Worksheet wks = Project.ActiveLayer();
wks.Columns(2).SetType(OKDATAOBJ_DESIGNATION_X);
LT_execute("wks.ColSel(3,1)");
LT_execute("wks.ColSel(5,1)");
LT_execute("wks.ColSel(7,1)");
LT_execute("Worksheet -p 247");
//use x-function to change plot type to scatter
GraphLayer gl = Project.ActiveLayer();
DataPlot dp = gl.DataPlots(0);
update_plot_type(dp, IDM_PLOT_SCATTER);
Can someone tell me why my OC-code doesn't work as it's supposed to but instead creates a grouped plot?
Thanks a lot
Seb