Forum Discussion
Change X-Axis scale to a time format on a scatter chart
- Oct 13, 2022
Doree515 Axis options are set to automatic by default. So Excel tries to create a nice looking axis with not too much clutter. You can override that by right-clicking (mouse) or two-finger-clicking (track pad) on the axis. Select "Format Axis..." Now, in the Options tab you can set the Bounds and Units for the axis.
BUT, it's not as straight forward with time values as it is with "normal" numbers. Time is stored as numbers, relative to one whole day of 24 hours (or 1440 minutes).
The above settings will create an axis from 00:00 (Minimum 0) to 08:00 (Maximum 0.33333). Note that the time value for 08:00 (8 AM) = 8 / 24 = 0.33333
Similarly, the Major Unit is set by taking the number of minutes between each label and divide that by 1440. Above I took 30 minute intervals. Thus, 30 / 1440 = 0.020833
The Minor unit calculated automatically.
In your particular situation, try setting the lower bound to 0.7986111 (being the time value for 01:55 i.e. 115/1440). Play around a bit with the upper bound and major units until you have the axis that looks good for you.
Doree515 Perhaps easiest to click on my name tag and send a file to me by a direct message.
- Doree515Oct 15, 2022Copper ContributorDone. I'm curious, where are you located? You seem to respond quickly.
- Riny_van_EekelenOct 15, 2022Platinum Contributor
Doree515 I'm living in the Central European time zone. I tend to be less active here after diner. That's why you had to wait a little bit longer this time.
As explained in my private message to you, creating scatter charts from dates and times is tricky. By default, Excel tries to be smart but get's the series all wrong. Using the underlying number values and then format the axis as date and time will work, though.
- Doree515Oct 16, 2022Copper ContributorRiny, This was my first-time using the Microsoft Techcommunity for help with a project. Thank you for your patience. I appreciate your taking the time to explain how to configure my data so my charts reflect the message I want to convey to my readers. My class ends in December, so I will use the site to help resolve any other issues I have using Excel. Thanks again!