Jeffrey Roosendaal
Jeffrey Roosendaal

Reputation: 7157

ECharts: Multiple series (lines) with own yAxis

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.

Upvotes: 10

Views: 33631

Answers (4)

Ayan
Ayan

Reputation: 8896

Here ar example from echarts for dual y axis:

Upvotes: 8

okokqi
okokqi

Reputation: 69

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
    }
  ],

Upvotes: 6

Ovilia
Ovilia

Reputation: 7256

Yes, ECharts supports multi-axis. See example at ECharts Gallery.

Upvotes: 0

Ray Li
Ray Li

Reputation: 11

You can add more than one y axis in echarts by making yaxis element as a array

Upvotes: 1

Related Questions