Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

294
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda