Jump to content
Software FX Community

How to get the number of points displayed on the chart


hasanma

Recommended Posts

The answer to this question depends on the type of chart.

If the X-Axis is categorical, you are not passing X-Values, the number of points and the scroll range are directly related, there is one point for each X-Axis unit. In this case obtaining the number of points within the current view can be done using the GetScrollView method in the X-Axis:

chart.AxisX.GetScrollView(out min, out max);

Note the GetScrollView returns the current view, therefore it can only be called after the scroll size and scale is calculated, that is after the chart is displayed. If you need to obtain this information before the chart is ever drawn, you need to force a size update before calling GetScrollView. The method UpdateSizeNow will do this for you.

If on the other hand your chart is an X/Y chart, the number of points and the X-Axis range are not related. The only way to obtain this number is to count the points. You can get the min and max using GetScrollView and then go through the points and test for their X-Value being within this range. 

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