To do this:
I tried to extract the hour number from the purchase date field and stored in my database.
However, when I plot the hour field on the X-axis, it does not include hours with “0” purchases, and I am unable to format the hour number as 0:00 AM, 1 AM, 2 AM, etc.
When you use the group by operator to get data prepared for display in a chart there is typically a small checkbox for ‘do not skip empty’…this needs to be checked so that hours with no values are not skipped and are included in the chart.
Have you solved this? I can think of a solution but not using pure Bubble.
Firstly, building your data structure in the way you want it to display e.g. showing each hour on the x axis and setting the value on the y axis to 0. You might create an object with the key as the time and value as the count.
Then, pull your data for each hour as you are doing. Store in an array/object.
Update your predetermined data structure populate corresponding values from your array. Those with 0 stay intact and matches should be updated.
I am not sure how you can achieve this using pure Bubble. You may want to explore JavaScript to bubble or another plugin.