I have several plots,so I want to create 2 YAxis in real time.
In CWGraph's wizard, I set 2Plot and 1xaxis, 2 yaxis .
In this case, multiplot run.
But create 2plot and 2 yaxis in programmatically.
In this case, multiplot don't run.
My programm coding's list are below.
CWAxesDisp cwaxes;
CWAxisDisp YAxis1,YAxis2;
CWPlotsDisp plots;
CWPlotDisp plot;
Variant index;
//set axes style
cwaxes = CWGraph1->Axes;
cwaxes.RemoveAll();
index=2;
YAxis1= cwaxes.Item(index);
cwaxes.Add();
index=3;
YAxis2=cwaxes.Item(index);
//Add YAxis2 at plot-2
index=2;
plot=plots.Item(index);
plot.YAxis=YAxis2;
plot.set_MultiPlot(true);
YAxis2.set_AutoScale(true);
// Plot Data
Single cal;
Variant data(OPENARRAY(int,0,1,0,99)),varSingle);
unsigned i;
for (i=0;i<100;i++){
cal=(Single)i*i;
data.PutElement(cal,0,i);
cal=(Single)i*2.0;
data.PutElement(cal,1,i);
}
CWGraph1->ClearData();
CWGraph1->PlotY(data);