Skip to content
On this page

双 Y 轴图

静态数据

js
{
  "xAxisData": [
    "1月",
    "2月",
    "3月",
    "4月",
    "5月",
    "6月",
    "7月",
    "8月",
    "9月",
    "10月",
    "11月",
    "12月"
  ],
  "categories": [
    "蒸发量",
    "降水量",
    "平均温度"
  ],
  "series": [
    {
      "name": "蒸发量",
      "seriesType": "bar",
      "data": [
        2,
        4.9,
        7,
        23.2,
        25.6,
        76.7,
        135.6,
        162.2,
        32.6,
        20,
        6.4,
        3.3
      ]
    },
    {
      "name": "降水量",
      "seriesType": "bar",
      "data": [
        2.6,
        5.9,
        9,
        26.4,
        28.7,
        70.7,
        175.6,
        182.2,
        48.7,
        18.8,
        6,
        2.3
      ]
    },
    {
      "name": "平均温度",
      "seriesType": "line",
      "data": [
        2,
        2.2,
        3.3,
        4.5,
        6.3,
        10.2,
        20.3,
        23.4,
        23,
        16.5,
        12,
        6.2
      ]
    }
  ]
}
{
  "xAxisData": [
    "1月",
    "2月",
    "3月",
    "4月",
    "5月",
    "6月",
    "7月",
    "8月",
    "9月",
    "10月",
    "11月",
    "12月"
  ],
  "categories": [
    "蒸发量",
    "降水量",
    "平均温度"
  ],
  "series": [
    {
      "name": "蒸发量",
      "seriesType": "bar",
      "data": [
        2,
        4.9,
        7,
        23.2,
        25.6,
        76.7,
        135.6,
        162.2,
        32.6,
        20,
        6.4,
        3.3
      ]
    },
    {
      "name": "降水量",
      "seriesType": "bar",
      "data": [
        2.6,
        5.9,
        9,
        26.4,
        28.7,
        70.7,
        175.6,
        182.2,
        48.7,
        18.8,
        6,
        2.3
      ]
    },
    {
      "name": "平均温度",
      "seriesType": "line",
      "data": [
        2,
        2.2,
        3.3,
        4.5,
        6.3,
        10.2,
        20.3,
        23.4,
        23,
        16.5,
        12,
        6.2
      ]
    }
  ]
}

属性

参数说明类型
xAxisData类目数据array
categories维度数据array
series图表数据值array

series

参数说明类型可选值
name数据项名称string
seriesType图表类型stringlinebar
data数据项数值array