Create a graph with "hours" on the x-axis
Solved
sara-87
Posted messages
79
Status
Membre
-
Pica -
Pica -
Hello,
I need to create charts based on statistics spanning 24 hours, with the hours on the x-axis. I want an option that allows displaying the hours from 0:00 to 24:00 with a step of 1 hour.
Please help me, I really need it.
Thank you.
I need to create charts based on statistics spanning 24 hours, with the hours on the x-axis. I want an option that allows displaying the hours from 0:00 to 24:00 with a step of 1 hour.
Please help me, I really need it.
Thank you.
1 réponse
Hello.
You need to:
* enter the hours in hh:mm format
* choose the type of chart as scatter plot
* right-click on the x-axis / Format Axis
* in the axis options, select fixed minimum and maximum values that are multiples of 1/24, that is,
} 0.125 to display 03:00 (3am)
} 0.250 to display 06:00 (6am)
} 0.375 to display 09:00 (9am)
} 0.500 to display 12:00 (12pm) etc.
and set 0.0416667 as the major unit so that the chart shows rounded hours on the hour axis.
https://www.cjoint.com/c/CDxdye3YxBf -------------> does that work for you?
Best regards
Retirement is great! Especially in the West Indies... :-)
☻ Raymond ♂
You need to:
* enter the hours in hh:mm format
* choose the type of chart as scatter plot
* right-click on the x-axis / Format Axis
* in the axis options, select fixed minimum and maximum values that are multiples of 1/24, that is,
} 0.125 to display 03:00 (3am)
} 0.250 to display 06:00 (6am)
} 0.375 to display 09:00 (9am)
} 0.500 to display 12:00 (12pm) etc.
and set 0.0416667 as the major unit so that the chart shows rounded hours on the hour axis.
https://www.cjoint.com/c/CDxdye3YxBf -------------> does that work for you?
Best regards
Retirement is great! Especially in the West Indies... :-)
☻ Raymond ♂
Thank you so much for what you have done for me. Without your help, I wouldn't know what to do. Actually, the data I have is in quarter-hour intervals, so 96 values over 24 hours (each hour has 4 values). At first, I didn't know how much 1 hour corresponded to in units, and I used 0.042 instead of 0.041667, but once I replaced it, everything became perfect. Thank you very much; you are saving my life.
In fact, you weren't far from the right solution; the more decimals you add to 1/24, the more accurate your graduations become.
Good luck.
So glad to have come across this discussion, I had been pulling my hair out about formatting the X axis in hours for a long time!
Thanks for the tip, indeed it only works with the "Scatter" type (nowadays it's called "XY (Scatter)" in Libre Office). Go figure why.
No need to calculate the fractions of hours for the units anymore, we can simply write them in HH:MM format.