Jump to content
Software FX Community

Drawing 50000 points doesn't seem ok on screen


hasanma

Recommended Posts

Hi,

I have an array with 50000 points. I use the following code to draw chart:

chart2.Gallery = SoftwareFX.ChartFX.

Gallery.Lines;

 double[] m_series1= new double[30000];

 

Random r = new Random();for (int i = 0; i < 30000; i++)

{

m_series1 = r.Next(0,100);

}

object[] allArrays = new object[1];

allArrays[0] = m_series1;

ListProvider lstProvider = new ListProvider(allArrays);

chart2.DataSourceSettings.DataSource = lstProvider;

chart2.AxisX.Title.Text = "Time Series";

chart2.AxisY.Title.Text =

"value %";

chart2.Titles[0].Text =

"ChartFX Demo";

 Above code generates Chart, that looks like a discontinued curve. Meaning the curve doesn't touch the right vertical

boundary. As I scroll, I get more points. But looking at the chart , it seems there are no more points. How should I code, so that the curve touches the right vertical boundary if there are more points to scroll.

Also, how can I get rid of the XAxis title "ChartFx for internal use of <companyName>"

I'm using VS2005 , chartFx v6.2 on Windows XP.

Thanx. 

 

 

 

Link to comment
Share on other sites

This is by design. Only the visible points are displayed.

You can make the chart an X/Y chart by supplying X and Y value. This will allow you to "extend" the line all the way to the boundary. This however will make the chart much slower as it will now go through all 30,000 points every time it draws. The reason is simple, once you have X values, we don't know whether you go back and forth or not, for a given range we don't know which points fall in it. The only way to find out is to go through all of them.

Link to comment
Share on other sites

What approach should I take to draw 50000 points with a good performance.

But I want the line all the way to the boundary. I was thinking to use following approach:

1. Bind some points to the chart & use X/Y chart.

2. As you scroll , discard some points & bind more points as follows:

if ((e.Axis.ScrollSize - e.Axis.ScrollPosition) == 1)

// add more points.

etc.

 

But not sure how to put all these together.

Can you pls advice.

Thanx 

 

 

post-2875-13922400540396_thumb.jpg

Link to comment
Share on other sites

Data Scrolling can be implemented as you described. There are Scroll events that allow you to capture the user actions and the Data API allows you to change the chart data at any time. It will take some coding though.

I would first try passing all the points to the chart and see if the performance is acceptable.

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.

×
×
  • Create New...