Search code examples
javascripthighchartspie-chartangular2-highcharts

Chart configurations in case of high number of legends


In our project we are using Pie chart. When Series count is less then 10-15, all slices are displayed fine, but as more values are added into the series Chart starts to shrink and Legends also show overflow arrow.

So, we are working on a requirement where top 10 counts will be shown on a Pie Chart with a option to load next set values in the series using some kind of control.

Does Highchart have any inbuilt support for the requirement like this?


Solution

  • You should be able to achieve a wanted result by dynamically changing the series data. To update the series data you can use the series.update feature.

    Demo: https://jsfiddle.net/BlackLabel/n9q324jx/

    chart.series[0].update({
        data: randomData(i)
    })
    

    API: https://api.highcharts.com/class-reference/Highcharts.Series#update