Highcharts pie rendering in conflict with legend

andrei

I have an example of a Highcharts pie with a top positioned legend.

    legend: {
        layout: 'horizontal',
        verticalAlign: 'top'
    }

http://jsfiddle.net/wt4rqudh/1/

There is an addSeries button in the demo which adds an inner pie chart. Because this adds more rows to the legend, the pie rendered is pushed down resulting in an incorrect behaviour.

Does anyone know how to fix this? The legend position must remain the same.

Halvor Holsten Strand

A method that makes this look somewhat smooth is:

  1. Doing the chart.addSeries, but without redrawing
  2. Doing an update on the original series, still not redrawing
  3. Do a chart.redraw() to position both series

In code this looks something like this:

chart.addSeries({
    // Series attributes ...
}, false);
chart.series[0].update(null, false);
chart.redraw();

See this JSFiddle demonstration of how it looks.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related