Jump to content
Software FX Community

Newbie RealTime chart question


mhowes
 Share

Recommended Posts

 I have data that comes in real time.

 I have 8 sets of data and I get a 8 x/y pairs at a time, one x/y pair for each series

 I run, add the points, and nothing shows up in the chart.

 Here is the function which I add a point at a time

  chartFx.RealTime.BeginAddData(1, RealTimeAction.Append);   chartFx.Data.Y[Channel, this.pnts] = Y;   chartFx.Data.X[Channel, this.pnts] = X;   chartFx.RealTime.EndAddData(true, true);   pnts++;

also, I don't know how many points I'm going to get and would rather not keep around a counter. Is there a way to truely append?

I tried the folowing

  chartFx.RealTime.BeginAddData(1, RealTimeAction.Append);   chartFx.Data.Y[Channel, 0] = Y;   chartFx.Data.X[Channel, 0] = X;   chartFx.RealTime.EndAddData(true, true); and nothing showed up as well

any help appreciated

thanks

mike

 

 

Link to comment
Share on other sites

This is the correct code:

  chartFx.RealTime.BeginAddData(1, RealTimeAction.Append);

  chartFx.Data.Y[Channel, 0] = Y;

  chartFx.Data.X[Channel, 0] = X;

  chartFx.RealTime.EndAddData(true, true);

 I don't know why you are not getting anything to show. I tried here and it shows just fine.

 Please attach a project that reproduces the problem.

Link to comment
Share on other sites

I am a good bit confused right now.

I commented out all the RealTime specific code. So I removed the BufferSize setting, the RealTimeMode and the Begin and End AddData, leaving this for adding point

  chartFx.Data.X[Channel, this.pnts] = X;   chartFx.Data.Y[Channel, this.pnts] = Y;

the chart works fine in this case.

but a couple general questions

First, I have both the X and Y axis AutoScale set to true. Does this work with RealTime charts?

Next, the only issue with doing it without RealTime (this is a guess on my part) is speed? The chart seems terribly slow. Even for the Form that the chart is one to initially display with no data points takes a good couple seconds. I'm replacing an old chart with ChartFX and the old chart seems a good 3X to 4X faster.

This is before points even get added to the chart. I'm not doing an 3D, it's a line chart with no markers, and no point labels

and lastly if the chart is working with the above to add the X/Y pair and AutoScale turned on, shouldn't all I have to do is add a buffersize (do I even have to do that?) add a Mode and wrap the the point adding in the Begin and End?  Well I guess I can remove the pnts counter and replace it with 0

thanks

mike

 

Link to comment
Share on other sites

One more piece of info. For kicks when I was trying to figure out what is wrong with my realtime charts

 I turned on the datagrid and all the data is in the charts datagrid and looks fine

 Then I turned on point labels and I see that all the points are basically bunched up with the correct Y values but all the X values are essentially zero

 I'm really starting to get the feeling it has to do with the fact that I'm adding an X/Y pair using Data.X and Data.Y

 all the examples are something like this

  chart1.Data[0, 0] = -50 + r.NextDouble() * 100;   chart1.Data[1, 0] = -50 + r.NextDouble() * 100;

 

 

 

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...