react-chartjs-2 icon indicating copy to clipboard operation
react-chartjs-2 copied to clipboard

How to display the legend text vertically?

Open spunbell opened this issue 8 years ago • 4 comments

I have created a Pie Chart using this package and have some labels representing my data.

legend: { position: 'bottom', fullWidth: true, labels: { boxWidth: 10 } }

I set these as my options so that the labels/legend would be below my pie chart as shown in the picture below:

image

How can I make my labels display vertically rather than one beside the other? Please let me know if you would like me to add any other code.

spunbell avatar Oct 18 '18 00:10 spunbell

Wha is the answer?

RenSolis avatar May 30 '19 01:05 RenSolis

if you make position: 'right' or 'left' you will get vertically in right side or left side of the chart

Prasad-YS avatar Jun 14 '19 04:06 Prasad-YS

Closing as not relevant to wrapper

pringelmann avatar Dec 05 '19 06:12 pringelmann

just add var chart = nv.models.pieChart() .x(function(d) { return d.label }) .y(function(d) { return d.value })
.legendPosition("right");

kdiaz10 avatar Jan 23 '20 00:01 kdiaz10