Code Guru
Code Guru

Reputation: 15578

selected Pie to be shown as popped out in highcharts

I am using pie chart of highchart. And i want by default one of the pie as selected.

To mark it a pie selected, I have changed the color of pie by using this setting

plotOptions: {
    pie: {
            allowPointSelect: true,
            cursor: "pointer",
            dataLabels: {
                enabled: true,
                format: "<b>{point.name}</b>: {point.y}"

            },
            selected: true,
            states: {
                select: {
                    color: "grey",
                    enabled: true,
                }
            }
        }
}

 

Highchart poput the pie if a select it using mouse.

I am able to chaneg the color but how can i achieve the popout effect?

Upvotes: 0

Views: 167

Answers (1)

Sebastian Wędzel
Sebastian Wędzel

Reputation: 11633

If you want to have a point selected on the initial load you need to set it in the particular point data object.

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

{
  name: 'Chrome',
  y: 61.41,
  sliced: true,
  selected: true
}

API: https://api.highcharts.com/highcharts/series.pie.selected

Upvotes: 1

Related Questions