i have 2 Doughnut that needs to be aligned 1 avobe another you can see in the image below: enter image description here
the Doughnuts are not aligned as you can see beacuse the labels length is not equal.
i have played with plugins.legend.labels alot but couldnt make the legend labels width to be fixed so the dougnt wont move according to the labels length.
** my code **
export const DEFAULT_DOUGHNUT_OPTIONS = {
maintainAspectRatio: false,
aspectRatio: 1,
resizeDelay: 1000,
// disable animation
animation: {
duration: 0, // general animation time
},
plugins: {
legend: {
labels: {
generateLabels: (chart: any) => {
const { data } = chart;
return generateLabels(data);
},
color: darkMainTextColor,
font: {
size: 14,
family: fontFamily,
},
usePointStyle: true,
boxWidth: 160,
padding: 10,
},
position: 'right',
rtl: true,
maxWidth: 160,
},
},
borderWidth: 1,
cutout: '80%',
};
tried to play with boxWidth , maxWidth and more... didnt help please help :)
thanks for the helpers.