【问题标题】:Google charts: Move legend position谷歌图表:移动图例位置
【发布时间】:2015-12-20 14:07:56
【问题描述】:

我正在使用 Google 图表来可视化我网站上的数据。我对 'visualization' 1.1 和 'pakcages' 行有疑问:

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

我尝试将图例列放在底部位置,其他谷歌图表类型我使用下一行并且它有效:

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

但是对于这种类型的图表不起作用,它将图例列放在右侧,就像您在我的网络的这张图片中看到的那样: chart example

谢谢!

【问题讨论】:

    标签: javascript google-visualization


    【解决方案1】:

    我相信语法是这样的:

    var options = {
    legend: 'bottom'
    };
    

    Source

    编辑: 实际上,它似乎还不被支持。只有正确或没有。 Source

    【讨论】:

    【解决方案2】:

    语法是 -

      legend: { 
              position: 'bottom', 
            alignment: 'center' ,
            orientation: 'vertical',
        }
    

    【讨论】:

      【解决方案3】:

      试试这个..

      legend: { position: 'top', alignment: 'end' },
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-03-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-08-23
        相关资源
        最近更新 更多