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

Archived

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

×
×
  • Create New...