Chart's X-axis lable rotation limitations- need help

Hi Team,

1. I am using Syncfusion chart Blazor, x-axis labels are having limited ways to rotate it, I need to make it in this way,
Image_5835_1728998222348

Currently if we do it in below way last label got partially hidden because of a space,
Image_7152_1728998292200

Please help me to make it like the first screenshot.

2. Also the Y-Axis label plotting is also with large gaps even we have data for the mid ones, for reference compare above two screenshots (0-5-10-...) and (0-10-20-...)

Thanks,
Kishor


3 Replies

DG Durga Gopalakrishnan Syncfusion Team October 16, 2024 01:23 PM UTC

Hi Kishor,


Greetings from Syncfusion.


1. I am using Syncfusion chart Blazor, x-axis labels are having limited ways to rotate it, I need to make it in this way,


Your requirement can be achieved by specifying LabelRotation as -25 for ChartPrimaryXAxis.


<SfChart>

    <ChartPrimaryXAxis LabelRotation="-25"></ChartPrimaryXAxis>

</SfChart>


Currently if we do it in below way last label got partially hidden because of a space.


By default, when axis labels extend beyond the chart area bounds, they will be cropped automatically. To prevent this and ensure the axis labels are fully visible without cropping, you can adjust the right margin of the chart.


<SfChart>

    <ChartMargin Right="20"></ChartMargin>

</SfChart>


2. Also, the Y-Axis label plotting is also with large gaps even we have data for the mid ones, for reference compare above two screenshots (0-5-10-...) and (0-10-20-...)


We suggest you to specify the Interval for ChartPrimaryYAxis to achieve your requirement. Please check with the below snippet and sample.


<SfChart>

     <ChartPrimaryYAxis Interval="5"></ChartPrimaryYAxis>

</SfChart>



Sample : https://blazorplayground.syncfusion.com/VNBzsNCHJxamRyGq


Please revert us if you have any concerns.


Regards,

Durga Gopalakrishnan.



KI Kishor replied to Durga Gopalakrishnan October 16, 2024 03:18 PM UTC

  1. Thank you for label rotation, it worked.
  2. On Y-axis interval, if we keep constant 5 or any number, it will not be adjusted for larger range,
    Image_6016_1729091898150



DG Durga Gopalakrishnan Syncfusion Team October 17, 2024 01:53 PM UTC

Kishore,


We suggested setting the interval based on your previous requirement. By default, when no interval is specified for the Y-axis, it is automatically calculated based on the provided Y-values in the datasource and the Y-axis height. We recommend removing the interval setting to allow for automatic interval calculation.


Please let us know if you have any concerns.



Loader.
Up arrow icon