score:0

Accepted answer

Cool question.

Your rotation algorithm is a bit flawed. Say, for example, you want the startAngle to be such that it rotates your 3rd slice to start at 0 degrees (top of the chart). This would be:

-(slice1ArcDegrees + slice2ArcDegrees)

The ArcDegrees can be found by:

 (percentage/100.0 * 360.0)

Putting this together in the point click handler:

  var points = this.series.points;
  var startAngle = 0;
  for (var i = 0; i < points.length; i++){
    var p = points[i];
    if (p == this)
    {
      break;
    }
    startAngle += (p.percentage/100.0 * 360.0);
  }
  this.series.update({
    startAngle: -startAngle + 180 - ((this.percentage/100.0 * 360.0)/2) // center at 180
  });

Here's an example.


Related Query

More Query from same tag