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

Regarding chart Y-axis scaling

Hi All,

I having problem while setting Y axis scaling in my control i setting scaling based on max and min value of series by runtime
------------------------------------------------
chartSeries.YAxis.RangeType = ChartAxisRangeType.Set;
chartSeries.YAxis.Range.Max = max + 1;
chartSeries.YAxis.Range.Min = min - 1;
chartSeries.YAxis.Range.Interval = (max - min + 2) / 10;
chartSeries.YAxis.Format = "#.###";

------------------------------------------------

i want set Y - axis scaling by hole number or decimal by equal (means 2.2,2.4,2.6 or 2,4,6 or 1,2,3 )
if the interval 1.6 then scaling will be from 3 to 17 but interval values are 3.56,6.11,7.67,9.22...till 17 here there is no order

can you please tell me how do i solve my problem?

waiting for reply...

Thanks and Regards
K.Sathishkumar


3 Replies

HA haneefm Syncfusion Team August 24, 2007 10:15 PM UTC

Hi Sathishkumar,

Thank you for using Syncfusion products.

You can display the scaling for some set of points by changing the secondary Y-axis's location and size. Please refer to the following code snippet.

protected void SetAxes()
{

axis1.LocationType = ChartAxisLocationType.Set;
axis1.Location = new PointF(this.chartControl1.PrimaryXAxis.Location.X, this.chartControl1.ChartArea.GetPointByValue(new ChartPoint(0, this.axis1.Range.Min)).Y);
axis1.AutoSize = false;
axis1.Size =new SizeF(0,(this.chartControl1.ChartArea.GetPointByValue( new ChartPoint(0 ,this.axis1.Range.Min )).Y
-this.chartControl1.ChartArea.GetPointByValue( new ChartPoint(0 ,axis1.Range.Max )).Y));
this.chartControl1.Redraw(true);
}

In our sample you can see secondary Y-axis scale place between 600 and 700 values of Primary Y-axis

Please have a look at this sample and let me know if this helps you.
ChartYAxisScalling

Best regards,
Haneef


SK Sathishkumar Kaliavaradhan August 31, 2007 09:23 AM UTC

Hi Haneef,

I think you didn't got my point because i asked about how to set scaling in such way the scaling interval should be equal( means interval either whole number or decimal but it should be equal from start to end e.g 2.2,2.4,2.6 or 2,4,6 or 1,2,3 )

Can you please tell me how do i set "Y-SCALING"?

Thanks and Regards
K.Sathishkumar


HA haneefm Syncfusion Team September 24, 2007 09:35 PM UTC

Hi Sathish,

Please try the below code snippet to scale the y-axis in a chart control.

this.chartControl1.PrimaryYAxis.RangeType = Syncfusion.Windows.Forms.Chart.ChartAxisRangeType.Set;
this.chartControl1.PrimaryYAxis.Range.Max = 100;
this.chartControl1.PrimaryYAxis.Range.Min = 0;
this.chartControl1.PrimaryYAxis.Range.Interval = 10;

Please refer to the attached sample for implmentation and let me know if this helps.
http://www.syncfusion.com/Support/user/uploads/Dir_4d4683d3.zip

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon