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

Message ListMessage List     Post MessagePost Message

  XYChart - Dynamic creation
Posted by JungHan Kim on Aug-16-2018 10:41
Hi. my name is Kim

I am not good at English, so I may not understand the sentence.

I have a question.

First, we are analyzing an example of ChartDirectormfcdemorealtimerack.
XYChart *c = new XYChart (600, 270, 0xf4f4f4, 0x0000, 1)

Create XYChart class, where I draw three signals on one bitmap control, and what I want to do is draw A signals on the bitmap control and not on the same y-axis when B signals are received. This is necessary in other areas. For example, if the value of the Y axis is 0 to 100, and the value of the Y axis is between 0 and 1, I would like to draw the signal separately rather than overlapping.

Secondly, do you have an API or class document? The documents on the homepage are inconvenient because there are no search conditions. Do you have any documents in pdf files that you can search and view right away?

Please reply.

Have a nice day then.

  Re: XYChart - Dynamic creation
Posted by Peter Kwan on Aug-16-2018 13:38
Hi JungHan,

For the y-axis, you can use two or multiple y-axes. Some examples are at:

https://www.advsofteng.com/doc/cdcpp.htm#dualyaxis.htm
https://www.advsofteng.com/doc/cdcpp.htm#multiaxes.htm

For example, in the original realtimetrack sample code, the "Alpha" lines is:

layer->addDataSet(DoubleArray(m_dataSeriesA, sampleSize), 0xff0000, "Alpha");

You can change the above to:

DataSet *ds = layer->addDataSet(DoubleArray(m_dataSeriesA, sampleSize), 0xff0000, "Alpha");
ds->setUseYAxis2();

Now the "Alpha" line will use the right y-axis.

Because the right side of the plot area is too close to the border, you may need to adjust it to reserve space for the right y-axis. To do this, please change the "setPlotArea" line to:

c->setPlotArea(55, 55, c->getWidth() - 90, 185, 0xffffff, -1, -1, 0xcccccc, 0xcccccc);


For the documentation, there is a CHM documention in "ChartDirector/doc". It would have search and index features. Please remember to "unblock" the documentation if you have not already done so, otherwise Windows may only display a blank page.

https://www.advsofteng.com/unblock_zip.html

Hope this can help.

Regards
Peter Kwan