prorigo said 2 years ago:
We are creating chart using C1.Win.C1Chart.C1Chart
we are setting the values of Y-axis as in a range between 0 to 85000
It’s creating intervals on Y-axis of value 50000 each. It’s creating the last interval of 400000, but our expected interval is 5,00,000 on the chart.
how to ensure that the range limit will be upper limit of the intervals i.e 500000 instead of 400000.
or is there any property on C1.Win.C1Chart.Axis this will return the interval slab so that we can adjust the max value.
ShashankB2p said 2 years ago:
It is not possible to display the maximum tick of any axis to be greater than it’s maximum value i.e the maximum value displayed at the axis is always less than or equal to the Axis’ maximum value (e.g. c1Chart1.ChartArea.AxisY.Max).Therefore you cannot display 500,000 to be maximum value when you have set c1Chart1.ChartArea.AxisY.Max=446000.
If you want to show the maximum value at the axis on chart to be same as provided it’s maximum value (i.e. c1Chart1.ChartArea.AxisY.Max) then all you need to do is to set the "UnitMajor" property of the axis to be such value which can divide the range(Min to Max value of axis) such that the final value displayed is the c1Chart1.ChartArea.AxisY.Max value and not lower than that.
In your case you can set the values as follows:
this.c1Chart1.ChartArea.AxisY.Min = 0; this.c1Chart1.ChartArea.AxisY.Max = 446000; this.c1Chart1.ChartArea.AxisY.UnitMajor = 44600;
After this the C1Chart willl display the maximum value 446000.
Please let me know in case I have misunderstood anything.
You must be logged in to reply to this topic.