Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
Echart combine line and horizontal bars

I trying to create two series on single chart: Line and Bars. Line and Bars have same values by Y, but Bars should be reversed by X, and should have different X values. I do not understand how to make bars horizontal in this case. Please see the example picture bellow: Echarts draws vertical bars (green) but I need horizontal (I've draw them as Red on picture). And here is the code:

option = {
  xAxis: [{
    data: ['2017-10-24', '2017-10-25', '2017-10-26', '2017-10-27', '2017-10-28']
  }, {
    inverse: true,
    type: 'value'
  }],
  yAxis: [{
  }, {
    type: 'value'
  }],
  series: [
    {
      xAxisIndex: 0,
      yAxisIndex: 0,
      type: 'line',
      data: [
        10, 15, 10, 20, 15
      ]
    },
    {
      xAxisIndex: 1,
      yAxisIndex: 0,
      type: 'bar',
      barWidth: 5,
      data: [[120,30], [300, 20]]
    }
  ]
};

enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!