3

Is it possible to achieve the same effect with the 'new' Google Charts API like in the deprecated Image Charts service where the labels are outside the chart and a line points to the right pie slice?

Important: I know how to create the pie chart, I just don't know how I can achieve the: labels outside the chart + lines layout.

How it should look (uses deprecated Image Charts):

enter image description here

EDIT: just to make sure you guys don't write down to much code, I am just searching for the right properties to achieve this. Thanks.

1 Answer 1

17

You can get a similar result by using the legend.position property and set its value to labeled.

Though the line points will be attached to the centers of the slices, it's not possible to reattach them to slice borders.

  var options = {
      legend: { position: 'labeled' }
  };

  // ...
  chart.draw(data, options);

The picture of the chart: Google pie chart with colored lines

1
  • Did not thought this would have been a property of the legend, so I really looked over it. Thanks a lot!
    – Ferdau
    Apr 17, 2014 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.