ChartFX Slowness

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Hi all,

I have a slight problem when using chartfx in vb.net. I have a line
graph that needs to be able to plot 10,000 points. I believe that this
isn't too unfeasible however whenever I begin plotting the points it
slows down immensely. If i Alt-Tab to another full screen application
and then Alt-Tab back a few seconds later, the graph has redrawn a lot
more of it that it would have had it been on the screen all the time.

This leads me to believe that it is due to the graph refreshing every
point whenever a new one is added. At my calculations that would mean
in total, the number of points actually plotted for a 10,000 point
graph is around 42 million! 10000 + 9999 + 9998 + ... etc.

Is there anyway around this so that the graph will only draw on the
last point added? The code snippet i am using is below:

For i As Integer = 0 To 10000 - 1

chtChart.OpenData(SoftwareFX.ChartFX.COD.XValues Or
SoftwareFX.ChartFX.COD.AllocHidden, SeriesCount, 10000)

chtChart.OpenData(SoftwareFX.ChartFX.COD.Values Or
SoftwareFX.ChartFX.COD.AllocHidden, SeriesCount, 10000)

'plot the point
chtChart.Value(SeriesCount - 1, i) = y
chtChart.XValue(SeriesCount - 1, i) = x
chtChart.Series(SeriesCount - 1).Tag = sp.scan.sampleName

Dim str As String = ""
str = "x: " & x.ToString("N1") & vbCrLf
str += "y: " + y.ToString("N3")

chtChart.Point(SeriesCount - 1, i).Tag = str

'Close the chart control for data
chtChart.CloseData(SoftwareFX.ChartFX.COD.Values)
chtChart.CloseData(SoftwareFX.ChartFX.COD.XValues)
Next
 
Check the programmer's guide under "Real Time Charts", there is API
there that will help you improve the prformance of this chart, among
the things you cna do is to "add" one point to the chart and refresh
only the new point.
 
Back
Top