Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you vertically center legends using Google Charts API?

I'm having trouble vertically centering the legends in Google Charts Pie Graph. Anyone have previously experience? Or is the best bet to code my own pie graph?

Thanks in advance, Walker

like image 241
Walker Avatar asked Dec 17 '22 18:12

Walker


2 Answers

Use the following in the charts option:

 var options = {
      title: 'My Daily Activities',
      legend: {'position':'top','alignment':'center'},
    };

The "legend.alignment" can be found in this documentation:

https://developers.google.com/chart/interactive/docs/gallery/piechart?csw=1

like image 152
jroi_web Avatar answered Mar 03 '23 03:03

jroi_web


Are you using the chdlp and chma parameters?

like image 44
Raph Levien Avatar answered Mar 03 '23 02:03

Raph Levien