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

282
Views
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 answers
Answer question

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 Report
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!