So, I would like to range my data and labels in Chartjs so that I can represent them properly. Please take a look at this reference which exactly shows what I am trying to do.
You can see that the data is grouped and ranged according to the order totals. The bar is then representing the total order counts.
One thing to notice here is that this data will change when the specified date range changes. However, the chart should always show 6 labels at max even if the date range changes, meaning, the data set changes (increases).
Now, I would like to know if this is possible directly in Chartjs where I add some funky option value to make it work automagically or, as I am working with PHP in the backend, there's a way in PHP where I can dynamically chunk these elements by only knowing the date range.
Please let me know if more explanation is required. Any help would be appreciated.
PS: I have database access and I have all the data required to display in the chart, just need to display it in the said format.