ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Four chart on the same screen
Posted by Oguz on Apr-01-2019 15:05
Attachments:
Hello,

I have two different x,y,z arrays and I'am trying to show those data as four chart together on the same screen. Two of the charts(one surface chart, one scatter chart) suppose to show the same x1, y1, z1 arrays, and the other two of the charts(which are again one surface and one scatter chart) suppose to show the x2, y2, z2 arrays. I have merged chart groups together and added them together to one multichart. The problem is, I cant not get a proper view of the charts at the same time. I'am keep loosing one of the charts.

MultiChart* m = new MultiChart(720, 600);
SurfaceChart *c_min = new SurfaceChart(720, 600);
SurfaceChart *c_max = new SurfaceChart(720, 600);

ThreeDScatterChart * c_max_scatter = new ThreeDScatterChart(720,600);
ThreeDScatterChart * c_min_scatter = new ThreeDScatterChart(720,600);

c_min->layout();
c_max->layout();

c_max_scatter->setBackground(Chart::Transparent);
c_max_scatter->setWallVisibility(false,false,false);

            c_max->makeChart()->merge(c_max_scatter->makeChart(),0,0,Chart::TopLeft,0);

            c_min->makeChart()->merge(c_min_scatter->makeChart(),0,0,Chart::BottomLeft,0);

m->addChart(0,0,c_min);
m->addChart(0,0,c_max);
viewer->setChart(m);

With the given code block I'am loosing the c_min_scatter's data point. If I change Chart::Bottomleft to Chart::Topleft, c_min surface chart disappears but c_min_scatter becomes visible again.

Corresponding view of the above code
forum1.PNG

  Re: Four chart on the same screen
Posted by Oguz on Apr-01-2019 15:25
Hello again,

I have managed to show the 4 charts together at the same time but the new problem is I cannot see scatter charts data points.

viewer->setImageMap(m->getHTMLImageMap("clickable", "",
                                               "title='(x={x|p}, y={y|p}, z={z|p}'"));

It seems like this line does not work for merged charts. How can I show the data point values?

Thank you.

  Re: Four chart on the same screen
Posted by Peter Kwan on Apr-01-2019 22:58
Hi Oguz,

May be instead of merge, you can try:

m->addChart(0,0,c_min);
m->addChart(0,0,c_min_scatter);
m->addChart(0,0,c_max);
m->addChart(0,0,c_max_scatter);

For using merge, I think the alignment should be "TopLeft" for both c_min_scatter and c_max_scatter.

If you take the image map from the MultiChart "m", it would work so long as the 3D Scatter Chart is added as a chart (using MultiChart.addChart). If the code uses "merge", it is just merging the DrawArea object (which can be treated like an image) returned by "c_min_scatter->makeChart()". Both the MultiChart does not see the "c_min_scatter", that's why the image map does not for "merge".

Regards
Peter Kwan