Google charts: Move legend position
Asked Answered
U

3

6

I am using Google Charts to visualize data on my website. I have a problem with the 'visualization' 1.1 and the 'pakcages' line:

google.load('visualization', '1.1', {packages: ['line']});

I try to put the legend column in the bottom position, with others Google Charts types I use the next line and it works:

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

But with this type of charts no works, it put the legend column in the right, like you can see in this image of my web: chart example

Thanks!

Undercharge answered 20/12, 2015 at 14:7 Comment(0)
H
9

I believe the syntax is like this:

var options = {
legend: 'bottom'
};

Source

EDIT: Actually, it seems to not yet be supported. Only right or none. Source

Hierology answered 20/12, 2015 at 14:15 Comment(3)
Hi Itamar. Thanks but no works. If you see the HTML code example of 'Creating Material Line Charts' in link and use the syntax of your anwers or mine the legend always be in the rightJetpropelled
Hm - works in classic - broken in Material. Seems to be an open issue: github.com/google/google-visualization-issues/issues/1964Hierology
Edited answer - it seems to not be supported yet: developers.google.com/chart/interactive/docs/…Hierology
K
5

Syntax would be -

  legend: { 
          position: 'bottom', 
        alignment: 'center' ,
        orientation: 'vertical',
    }
Kalmia answered 2/1, 2019 at 6:50 Comment(0)
P
4

Try this..

legend: { position: 'top', alignment: 'end' },
Pangermanism answered 26/10, 2016 at 11:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.