【问题标题】:Legend in Linechart- google-charts-react折线图中的图例- google-charts-react
【发布时间】:2019-06-24 08:11:14
【问题描述】:

我正在使用来自 google-chart-react 的 Linechart。

问题是我无法将图例位置更改为底部,停留在右侧。

我试过了:

    width={'70%'}
    height={'200'}
    chartType="Line"
    data={dats}

     options={{
      legend:'bottom',
      colors:['#95a0be','#90d6db'],
      width: 800,
      height: 300,
      series: {

        // Gives each series an axis name that matches the Y-axis below.
        0: { axis: 'Temps' },

      },....

【问题讨论】:

  • 我不认为它是这样工作的。我只能在我的图表上从左到右更改它。图例:{位置:“左”}

标签: reactjs linechart


【解决方案1】:

如果您使用 react-google-charts, 设置 chartType = "LineChart" 和图例:{ position: 'bottom' }

  <Chart
    ...
    chartType="LineChart"
    options={{
      ...,
      legend: { position: 'bottom' },
    }}/>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-12-07
    • 1970-01-01
    • 2012-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-18
    • 2020-05-16
    相关资源
    最近更新 更多