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.

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()]
}
]
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