折线图(Dual-Y)x轴数据的顺序相反

时间:2018-11-23 18:47:45

标签: charts google-visualization

我正在处理双y轴折线图,并试图以相反的顺序在x轴上显示数据。

direction属性似乎对我不起作用。

原始- https://jsfiddle.net/api/post/library/pure/ 这是我的更改- https://jsfiddle.net/3m8vjows/

我试图将方向指定为x轴,如下所示。但是不起作用。

  var materialOptions = {
    chart: {
      title: 'Average Temperatures and Daylight in Iceland Throughout the Year'
    },
    width: 900,
    height: 500,
    series: {
      // Gives each series an axis name that matches the Y-axis below.
      0: {axis: 'Temps'},
      1: {axis: 'Daylight'}
    },
    axes: {
      // Adds labels to each axis; they don't have to match the axis names.
      y: {
        Temps: {label: 'Temps (Celsius)'},
        Daylight: {label: 'Daylight'}
      },
    x:{direction:'-1'}
    }
  };

1 个答案:

答案 0 :(得分:1)

材料图图表不支持以下配置选项

{hAxis,vAxis,hAxes.*,vAxes.*}.direction

有几种 material 图表不支持的选项,
参见-> Tracking Issue for Material Chart Feature Parity

材料 = google.charts.Linepackages: ['line']

经典 = google.visualization.LineChartpackages: ['corechart']


您可以使用一个选项来使经典图表与 material

看起来相似
theme: 'material'

如果您选择使用经典代替...