You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently point labels of a polar chart are drawn in line with the angle lines:
Feature Use Case
For labeling the different slices, instead of using a legend and colors, I'd like to use point labels but center align them to the pie slices, like:
I need to label / explain which slice is what. Instead of relying on a legend and colors I'd like to add labels next to the slices. Using point labels comes close, but their position is confusing.
Feature Proposal
Aligning point labels to slices of a polar chart:
Currently point labels of a polar chart are drawn in line with the angle lines:
Feature Use Case
For labeling the different slices, instead of using a legend and colors, I'd like to use point labels but center align them to the pie slices, like:
I need to label / explain which slice is what. Instead of relying on a legend and colors I'd like to add labels next to the slices. Using point labels comes close, but their position is confusing.
Possible Implementation
A new property that allows aligning the point labels differently.
https://www.chartjs.org/docs/latest/axes/radial/linear.html#point-label-options
Or maybe a new way to add labels to charts, similar to datalabels, but then always on the outside to label slices. Echarts for example supports these:
https://echarts.apache.org/examples/en/editor.html?c=pie-simple
https://echarts.apache.org/examples/en/editor.html?c=bar-polar-stack-radial
Workaround
Through this StackOverflow answer I found a workaround using the datalabels plugin. Simple example:
https://codepen.io/peteruithoven/pen/mdwxaMP?editors=0010
But this requires a plugin, manually increasing the padding, adjusting an offset through a onResize handler and calling this handler initially.
Simple example with default point labels:
https://codepen.io/peteruithoven/pen/LYLdMBE?editors=0010
The text was updated successfully, but these errors were encountered: