Replies: 1 comment
-
Here are two options you can try:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey !
![Screenshot 2021-11-23 180053](https://user-images.githubusercontent.com/70433439/143059567-407fbae7-7e81-45ac-88e2-1c1f93c5064e.png)
i have 2 Doughnut that needs to be aligned 1 avobe another
you can see in the image below:
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.
Beta Was this translation helpful? Give feedback.
All reactions