Jump to content
Software FX Community

Real-time XY once more


User (Legacy)

Recommended Posts

Dear reader,

It has been mentioned a few times that real-time XY is not possible in

ChartFX (Correct me please if I'm wrong) As I also have the need for this

type of chart, I've been trying to use the XY Line as the vehicle to

accomplish this by doing the following:

- Fill in new points as they become available using .XvalueEx(i,j) and

.ValueEx(i,j) and increase j = j + 1

- When the next point would disappear at the right (most recent) side of the

chart, adjust the min and max properties of the X axis of the chart.

- Update the X label strings, effectively scrolling the X-axis.

The effect is that the chart scrolls to the left.

I have not used any of the properties specifically for real-time charts like

CT_EVENSPACING, .RealTimeStyle, .MaxValues or COD_ADDPOINTS.

However, the index j in .XvalueEx(i,j) exceeds the maximum number of points

defined with the OpenDataEx method. I ran a test successfully with 10000

points while the number of samples was kept at 200, but I expect that sooner

or later something must go wrong because of the continuing increase in

memory demand.

My question is if there is a method to periodically release the memory of

the oldest, invisible points in the chart. I can think of some methods to do

programmatic bookkeeping, but maybe there is a smarter way to maintain a

real-time XY. How do other people do this? I know that setting the

.MaxValues property, which seems the intuitive way to handle this, will not

work, I've tried it.

Henk Borsje

Link to comment
Share on other sites

Hi,

It is not that you can not update an XY chart in real-time, it is that you

can not "add" points to an XY chart the way you might do in a real-time

chart.

Basically you can, in any type of chart reset or add data to the chart at

any time.

Circular buffers (used when MaxValues is set) is not supported for x-values,

what this means is that the first point is always going to be the first

point in the buffer, hence to eliminate this point, you need to move all the

values one step back (XValue(i) = XValue(i+1)). This can be costly,

specially if you want very quick updates but it is the only way to have data

circulating in XY charts.

So in your specific situation, you have to decide how many points you want

to keep and after that number is reached, you stop increasing the number of

points passed in OpenDataEx and instead, move points back and then assign

the last point only.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

SoftwareFX Support wrote in message ...

>Circular buffers (used when MaxValues is set) is not supported for

x-values,

>what this means is that the first point is always going to be the first

>point in the buffer, hence to eliminate this point, you need to move all

the

>values one step back (XValue(i) = XValue(i+1)). This can be costly,

>specially if you want very quick updates but it is the only way to have

data

>circulating in XY charts.

>

Is it possible to do a memmove() on the XValue and Value arrays?

If so, is it guaranteed to stay that way in future releases?

Henk Borsje

>--

>FP

>Software FX, Inc.

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...