3

My Problem : Chart size is fixed including legends.

I want to fixed pie chart size except legends. How can I make the pie chart the same size?

This is my code. Help me plz

var options = {
          series: [25, 15, 44],
          chart: {
            type: 'pie', 
            **width: '300px'**
        },
        labels: ["Monday", "Tuesday", "Wednesday"],
        theme: {
          monochrome: {
            enabled: true,
            color: '#f38200',
            shadeIntensity: 0.9
          }
        },
        plotOptions: {
          pie: {
            size : "200px"
          }
        },
        stroke: {
          show: false
        },
        dataLabels: {
          enabled: false
        },
        legend: {
            position: 'bottom',
            horizontalAlign: 'left',
            markers: {
                width: 9, height: 9
            },
            itemMargin: {
                horizontal: 20, vertical: 0
            },
            formatter: function(seriesName, opts) {
              ~~~~~~~
              return legend;
            }
          }
        };

IMG - This is my problem

jwjung
  • 31
  • 2

2 Answers2

1

Try setting the legend width or height to a static value, e.g.

legend: {
  width: 200
}
Alex Hicks
  • 11
  • 2
0

Try using -

legend: {
  floating: true
}

and setting the legend's position using offsets.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Shhh
  • 1
  • 2