I am currently working with a highchart where I have manually coded the xAxis categories. The filteredDatas.xAxis array contains dates, while filteredDatas.xAxisTime has 24 values representing 24 hours in a day.
xAxis: {
categories: [{
name: filteredDatas.xAxis[0],
categories: filteredDatas.xAxisTime
}, {
name: filteredDatas.xAxis[1],
categories: filteredDatas.xAxisTime
}, {
name: filteredDatas.xAxis[2],
categories: filteredDatas.xAxisTime
}, {
name: filteredDatas.xAxis[3],
categories: filteredDatas.xAxisTime
}, {
name: filteredDatas.xAxis[4],
categories: filteredDatas.xAxisTime
}, {
name: filteredDatas.xAxis[5],
categories: filteredDatas.xAxisTime
}, {
name: filteredDatas.xAxis[6],
categories: filteredDatas.xAxisTime
}],
},
However, when I select date ranges exceeding 7 days, the x-axis labels do not display correctly.
I believe that dynamically pushing the name and categories using a for-loop and accumulator is the solution. I'm struggling to figure out the syntax for this task as I need to loop N times to include N sets of filteredDatas.xAxis and filteredDatas.xAxisTime values. As a beginner in highcharts, any guidance on how to achieve this would be greatly appreciated.