We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Chart Y Axis scaling problem

When I add a custom point to a series of charts, sometimes the automatic chart Y axis scaling is such that the custom point is not on the chart. Here is an example of my code. myCharts.PrimaryYAxis.RangeType = ChartAxisRangeType.Auto Dim Series1 As ChartSeries Dim CusPoint As New ChartCustomPoint() series1 = ... (fill Series1 up with data) cusPoint = ... (put data into cusPoint) myCharts.Series.Add(Series1) myCharts.CustomPoints.Add(CusPoint) The Y range of the data in "Series1" is from 1000 - 1220. The Y value of CusPoint is 1250. Series1 plots fine. However, because the chart is automatically scaled from about 900 to 1230, cusPoint never shows up. Is there a problem with the automatic scaling algorithm? Do I need to do things in a different order? Thanks, Bill

5 Replies

DJ Davis Jebaraj Syncfusion Team February 25, 2004 02:26 PM UTC

Hi Bill, The ChartControl does not compute the X axis or Y axis range taking into account the custom points. You should set the range of the Y axis to be a custom value (when the custom point is not within the range of the series points): Me.ChartControl1.PrimaryYAxis.RangeType = ChartAxisRangeType.Set Me.ChartControl1.PrimaryYAxis.Range.Min = 1000 Me.ChartControl1.PrimaryYAxis.Range.Max = 1350 Please see the sample linked to below: http://www.syncfusion.com/support/user/Uploads/ChartCustomPoint_3936.zip Regards, Davis


BK Bill Korchinski February 27, 2004 01:21 PM UTC

Thanks- WK


EN Ed Noepel January 19, 2007 04:56 PM UTC

>The ChartControl does not compute the X axis or Y axis range taking into account the custom points.

Is this also an issue for non-custom points when the series is updated in real time? I have:

_chart.PrimaryYAxis.RangeType = ChartAxisRangeType.Auto;

I make a change to the data in the series and call:

_chart.PrimaryYAxis.Update()

afterwards, but the Y-axis never updates.


SB Suresh Babu Syncfusion Team January 20, 2007 12:25 AM UTC

Hi Ed,

You can change the Range Type to 'Set' or 'Auto' with in Chart Control's Begin Update and End Update. For example, Please have a look into the below sample code.

[C#]
this.chartControl1.BeginUpdate();
this.chartControl1.PrimaryXAxis.RangeType = ChartAxisRangeType.Auto;
this.chartControl1.EndUpdate();

Please find the sample attached.

Chart Axis Range sample

Please let me know if this helps.

Regards,
Sureshbabu


AD Administrator Syncfusion Team January 22, 2007 07:18 PM UTC

If I make changes to a datapoint inside a Begin/EndUpdate block, the axes update appropriately.

>Hi Ed,

You can change the Range Type to 'Set' or 'Auto' with in Chart Control's Begin Update and End Update.

Loader.
Live Chat Icon For mobile
Up arrow icon