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

Message ListMessage List     Post MessagePost Message

  How to Add a Track Point to the Last Point of a Real-Time Chart?
Posted by Fabio on Dec-31-2015 01:57
Hello,

I need to add a track point (highlight) to the last point of a real-time XY scatter chart. About every second a new point is added to the chart, and I want to highlight each time just that last point with a bigger (more pixels) circle symbol, for example. How can I do that, if possible?

I adapted the Qt example xyzoomscroll, and made it real-time with one line layer. I am using ChartDirector 6.0 with Qt C++ 5.5 on both Windows 7 and desktop Linux (K)Ubuntu 15.

Thanks in advance,

Fabio

  Re: How to Add a Track Point to the Last Point of a Real-Time Chart?
Posted by Peter Kwan on Jan-01-2016 01:20
Hi Fabio,

Just add another scatter layer with just one point, which is the point you want to highlight.
The point can be using a special color, shape, or use a big hollow circle to enclose the
existing point. A hollow circle symbol can be achieved by using the circle symbol with a
transparent fill color and non-transparent border color, and the border can be set to a
thicker line width. For example:

ScatterLayer *specialLayer = c->addScatterLayer(DoubleArray(&lastXCoor, 1),
DoubleArray(&lastYCoor, 1));
specialLayer->getDataSet(0)->setDataSymbol(Chart::CircleSymbol, 19, Chart::Transparent,
0xff0000, 4);

Hope this can help.

Regards
Peter Kwan

  Re: How to Add a Track Point to the Last Point of a Real-Time Chart?
Posted by Fabio on Jan-05-2016 01:12
Hi Peter,

I just copied the sample code to my application, and it worked as expected highlighting the last point of the series.

You may consider this question/issue as answered/resolved.

Again, many thanks,

Fabio