As a newcomer to Chart.js, I am encountering some challenges. My goal is to create a bar chart that displays hourly information. However, when attempting to show data for a week, a month, or an extended period, I face issues with reducing the labels on the x-axis. For example, in a week there are 168 hours, and I only want to display the days at midnight (00:00). To achieve this, I set empty strings for other times, but unfortunately, the chart shows "undefined" instead of displaying all the days. In the image provided, only 10 hours have information, while the remaining values are zero. https://i.sstatic.net/hs8i5.png
This problem becomes more complex when dealing with a month or six months' worth of data, where I aim to show only the first day of each week. While I can adjust the logic to reduce labels, I'm unsure how to prevent the display of "undefined" on the x-axis labels.