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

PrimaryYAxis.Range property

Hello,

When I set the PrimaryYAxis.Range.Max property into a specific value the columns does not start from zero at the y-axis (which I get when the chart automatically calculates the range). Which property should I use to achieve this?
Best regards,
mariana

5 Replies

AD Administrator Syncfusion Team September 29, 2006 07:37 AM UTC


Hi Mariana,

You need to assign RangeType of PrimaryYAxis to "Set" to get the desired range.

The following code illustrate this :

this.chartControl1.PrimaryYAxis.RangeType=ChartAxisRangeType.Set;
this.chartControl1.PrimaryYAxis.Range.Min=0;
this.chartControl1.PrimaryYAxis.Range.Max=100;
this.chartControl1.PrimaryYAxis.Range.Interval=20;

Thank you for your continued interest in Syncfusion products.

Regards,
Jaya


MA Mariana September 29, 2006 09:25 AM UTC

Hello,

Thanks for the quick answer.
In my application I have columns that have negative values and therefore I can''t set PrimaryYAxis.Range.Min=0.
Is there any other way to solve the problem?

Best regards,
Mariana


AD Administrator Syncfusion Team September 29, 2006 12:22 PM UTC


Hi Mariana,

Thanks for the update.

It is possible to set the Axis range start from zero even if the negative points are plotted in the chart. This can be achieved by removing the existing Axis labels and creating custom labels with the desired range and interval.


Please try the attached sample and let me know if this helps.

Regards,
Jaya

Range.zip


MA Mariana October 16, 2006 12:02 PM UTC

Hello,

Thanks for the support.
I removed the existing Axis labels and created custom labels with the desired range and interval in my application but still I have a problem, the gridlines is not synchronized with the label tick, see attached image.

The columns in my application can change from having values between -40000 to 40000 and all values in between (depends on the setting the user makes) and I always need to have the zero with.
Is there a easier way to set the axis interval by just using the range.max and range.min property?

I also have another question. The reason to why I need to resize the chart is that when I have the columns labels aligned vertically they somethimes don't fit in the chart. Is there any function where this resizing can be made automatically?

Best regards,
Mariana

gridlines.zip


AD Administrator Syncfusion Team October 17, 2006 10:16 AM UTC

Hi Mariana,

Thanks for using syncfusion products.

1) I am able to reproduce the issue about Axis labels synchronize.

For that you have to set ChartAxisRangeType to ‘Set’ before setting the minimum and maximum values. And the interval should be set properly.


2) I am afraid this feature has not yet been implemented in chartControl. I will create a feature request on this and will update you as soon as the feature is implemented.

Please take a look at the attached sample. Let me know if this helps.

Thanks,
Sureshbabu


Axis Range with Custom label.zip

Loader.
Live Chat Icon For mobile
Up arrow icon