更改时间轴插件echarts的yAxis

时间:2018-11-07 09:38:50

标签: echarts

更改时间序列时需要更改轴,在图表v3中可以吗?因此,当我选择的团队A时,显示y轴0,而选择团队2时显示y轴1。

enter image description here

echarts.init(this.$refs.chart).setOption({
    baseOption: {
      timeline: {
        axisType: "category",
        data: ["Team A", "Team B"]
      },
      xAxis: {
        type: "value",
        boundaryGap: [0, 0.01]
      },
      yAxis: [
        {
          type: "category",
          data: ["A", "B", "C", "D", "E"],
          axisLabel: { interval: 0 }
        },
        {
          type: "category",
          data: ["BC", "CC", "FF", "RR", "HH"],
          axisLabel: { interval: 0 },
        }
      ]
    },
    options: [
      {
        series: [
          {
            name: "Billed",
            type: "bar",
            data: [20, 20, 30, 40, 50]
          },
        ]
      },
      {
        series: [
          {
            name: "Billed",
            type: "bar",
            data: [120, 20, 30, 40, 50]
          },
        ]
      }
    ]
  });

0 个答案:

没有答案