Jump to content
Software FX Community

Chart set up question


Mirek

Recommended Posts

Hello,

This is another newbie question.

I need to set up a line chart showing three curves of which two are static (effectively, they are part of the chart's layout) and the third one is dynamic, that is it evolves in time as real time data cames in. Data arrives rather frequently and the chart update takes time with my current setting, it significantly slows down the entire application.

I'm wondering what would be the optimal set-up for my chart. I've read some of the documentation and I learned about "Real time charts" and saw a demo app. However, they seem incompatible with my static data.

Is it possible to have both static and real time data on "Real time chart"?

Any tips on how to set up the chart in my scenario to optimize performance are welcome.

Thanks in advance!

 

 

 

Link to comment
Share on other sites

Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

If I understood correctly my following two ideas should work:

 

a) Create two constant lines for your contact series, they will remain along you real time series. Read about sections or CustomGridLine in Chart FX for VS2005 Resource Center help file.

B)   Create two more series using a constant value. For example

chart1.RealTime.BeginAddData(2, RealTimeAction.Insert);

Random r = new Random();

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

chart1.Data[1, 0] = 2;

chart1.Data[2, 0] = 18;

maxx = Math.Max(maxx, chart1.Data[0, 0]);

maxx = Math.Max(maxx, chart1.Data[1, 0]);

chart1.AxisY.Max = maxx;

chart1.AxisX.ScrollPosition = chart1.AxisX.ScrollSize;

if ((chart1.DataGrid.ScrollSize > 0) && (chart1.DataGrid.ScrollSize < chart1.Points.Count))

chart1.DataGrid.ScrollPosition = chart1.DataGrid.ScrollSize;

chart1.RealTime.EndAddData(button2.Enabled, true);

 

 

<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />

 

Link to comment
Share on other sites

Hi,

thanks for your quick answer!

I was trying to apply your idea but it looks like the API is different. My chart1 of type Chart (ChartFX for .Net v. 6.2) does not have property RealTime or Data. Are we talking about two different products/versions? 

 

Link to comment
Share on other sites

Sorry for the confusion but your questions is posted in the Chart FX for VS2005 forum group.

For Chart FX for .NET 6.2 you may look for "Constant lines" in the Resource Center installed with Chart FX.

In Chart FX for.NT 6.2 you can create  constant line as follows:

Set constantline = Chart1.ConstantLines(0)

constantline.Axis = AxisItem_Y

constantline.Value = 75

constantline.Color = RGB(128,0,128)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

Link to comment
Share on other sites

Sorry for the confusion - I didn't realize there is a difference between Chart FX for VS 2005 and .NET.

The problem I have is that my static lines are not simple constants - they are curves of very irregular shape. The story is that static curves correspond to what's predicted or desired whereas the real time one shows what the reality brings. That's the motivation for the chart. My application is a simulation engine and the chart is one of the most important feedback components. It's critical that it performs. As I'm not very familiar with the API I don't know how to set it up in a  most lightweight way. If you have any suggestions please let me know. And sorry for being imprecise.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...