ECharts: Multiple series (lines) with own yAxis

Jeffrey Roosendaal picture Jeffrey Roosendaal · Apr 11, 2016 · Viewed 11.6k times · Source

I want to switch from Highcharts to ECharts (preferably 3), but my current graphs have multiple series ('lines' in my case), with each their own yaxis, and it seems ECharts doesn't support this.

enter image description here

These metrics do not relate at all, so they all need their own yaxis. I combine them in 1 chart so they can be compared relative to each other (500 visits, €30000, 3% conversion.. etc). It makes no sense to plot 500 visits and 3% conversion rate on the same yaxis.

Is there a way to give each line it's own yaxis? It doesn't have to be a visible one (since there can only be two with ECharts, left/right of canvas, and that's ok), but the data needs to be plotted to an individual axis.

Answer

okokqi picture okokqi · Aug 1, 2016

try this

 yAxis: [
    {
      type: 'value',
      name: 'left_yaxis',
      nameTextStyle: {
        color: '#fff'
      },
      splitLine:{
        show:false,
      },
      axisLabel: {
        textStyle:{
          color:'#fff',
        }
      }
    },
    {
      type: 'value',
      name: 'right_yaxis',
      nameTextStyle: {
        color: '#fff'
      },
      axisLabel: {
        interval:'0',
        textStyle:{
          color:'#fff',
        }
      },
      splitLine: {
        lineStyle: {
          color: ['#454545'],
        }
      },
      min:0,
      //max:800000,
      splitNumber:5
    }
  ],