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

290
Visualizações
Is there a way to plot date ranges (Start Date/End Date) value on Echarts Bar Chart?

I was wondering if this can be done on echarts.

I have categories on the y-axis and date values on the x-axis. The values will be the start date and end date for the category.

This is the chart produced by the code below. enter image description here

xAxis: {
    type: 'time',
    axisLabel: {
          formatter: function (value, index) {
              var date = new Date (value);
              return date.toLocaleDateString("en-US")
          }
      }
  },
  yAxis: {
    type: 'category',
    data: ['Category1', 'Category2', 'Category3', 'Category4', 'Category5', 'Category6'],
    axisLine: { show: true },
  },
  series: [
    {
      name: 'Task 1',
      type: 'bar',
      data: [
          new Date('2022-04-10').getTime(), 
          new Date('2022-04-12').getTime(),
          new Date('2022-04-14').getTime(),
          new Date('2022-04-16').getTime(),
          new Date('2022-04-18').getTime(),
          new Date('2022-04-20').getTime(),
        ]
    },
    {
      name: 'Task 2',
      type: 'bar',
      data: [
        new Date('2022-04-04').getTime(), 
        new Date('2022-04-07').getTime(), 
        new Date('2022-04-08').getTime(),
        new Date('2022-04-03').getTime(),
        new Date('2022-04-09').getTime(),
        new Date('2022-04-12').getTime()]
    }
  ]

What I wanted to achieve is something like this. enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Got this answer from echarts' dev which is also the same suggestion by @Muhammad.

https://echarts.apache.org/examples/zh/editor.html?c=bar-waterfall

about 4 years ago · Juan Pablo Isaza Relatório
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