Jump to content
Software FX Community

Compact() gets rid of all series except first?


briangreen
 Share

Recommended Posts

Hi,

I'm working on a real-time charting program that contains multiple panes and multiple series. I am also loading in data from a local file and merging it with the live data to create a continuous time series. I'm trying to use the Chart1.Data.Compact( Double x) to clean up the data because it is coming in very frequently and has a lot of noise. Whenever I call the compact method, it works for the first series on my chart, but the other series are not plotted on my chart anymore. They are still present because I can UndoCompact and see them again. Is this the typical behavior of the compact method? If not, does anyone have any clue why the compact method is taking my other series off the chart?

Link to comment
Share on other sites

I believe I have isolated the problem. Because my datapoints are coming in Asynchronously, they are not sharing X-axis points. As such, my chart.data array has dimension of N where N is the number of series, but each series is being stored using M data points where M is the total number of points on the chart, not the actual number of points in the series. For example, if series 1 has 20 points, series 2 has 30 points, and series 3 has 40 points, then the array for the first series would have length 90, with its points stored only in the first 20. the remaining 70 entries take on the default missing value of 1.0E+108. As new points come in, they are added to the end of the whole list, not at the end of it's section. My guess is that as soon as the compact method sees one of the 1.0E+108 values, it stops, marks how long the list was, and starts looking at the other series, but only for this same length. Therefore, it never sees the data that is present in the other series, and also never sees the new points that are coming in. This would also explain why when I have only one series, It is actually able to see the new points, because there are never any 1.0E+108 values in the data array.

Any thoughts on a workaround?

post-5507-13922409418125_thumb.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...