chartjs / Chart.js

Simple HTML5 Charts using the <canvas> tag
https://www.chartjs.org/
MIT License
64.85k stars 11.93k forks source link

rtl options for axis and labels #11937

Open Vatsal6288 opened 1 month ago

Vatsal6288 commented 1 month ago

Currently, Chart.js supports right-to-left (RTL) layout for legends and tooltips, but other chart elements like axes, labels, and some other components still use left-to-right (LTR) format. This creates an inconsistency when building charts for RTL languages.

It would be helpful if Chart.js provided full RTL support for all chart elements, not just legends and tooltips. This would ensure that the entire chart aligns correctly for RTL languages, making it more cohesive and user-friendly.

If there's another solution or workaround to achieve this without needing options for every individual element, please let me know.

LeeLenaleee commented 3 weeks ago

Maby I am understanding you wrong, in which case please correct me. But by default the labels for the ticks in the scales are centered. In which case it won't make a difference.

You can already set the alignment of the ticks to start or end instead of center I think will give you the same effect you are looking for.

https://www.chartjs.org/docs/4.4.6/samples/scale-options/ticks.html