0

For the life of me I can't get the Google Chart Legend to NOT be shown, even though I'm specifying "NONE." (also noted here: Hiding the legend in Google Chart ).

$options = array(   'title' => 'Average Load Summary', 
            'titlePosition' => 'in', 
            'legend.position' => 'none',
            'width' => 1100, 
            'height' => 700, 
            'hAxis.slantedTextAngle' => 90, 
            'hAxis.position' => 'out', 
            'pointSize' => 5, 
            'hAxis.title' => 'Stops');

Further, I can't get the slanted text angle to go horizontal (90 degrees), such that my entire label will be shown. Right now google adds "..." to my labels and they are at about a 45 degree angle. Finally, I also cannot get the hAxis.title or vAxis.title to be displayed, not matter what...

Thanks for any help anyone might have. This is a lineChart by the way...

Community
  • 1
  • 1
Shackrock
  • 4,601
  • 10
  • 48
  • 74

1 Answers1

4

Where you have this:

'legend.position' => 'none',

Try doing this:

'legend' => array('position' => 'none'),

For the other:

'hAxis' => array('title' => 'Stops', 'position' => 'out', 'slantedTextAngle' => 90),

Basically legend and hAxis accept multiple parameters, so they would each have their own array of options. There is only one parameter for something like width and height.

In javascript it would look like this:

var options = {
   title: 'Average Load Summary'
   ,legend: {position: 'none'}
};
gorelog
  • 108
  • 1
  • 6
  • I should have updated this question, I inadvertently got it answered in a future question. But thanks! =) – Shackrock Apr 23 '12 at 21:36
  • How do I hide a particular legend when it is clicked? http://stackoverflow.com/questions/23609797/hide-specific-legend-in-google-chart – Rahul Desai May 12 '14 at 13:34