Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

188
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda