Wrong axis values in Numbers chart

I plug the time I leave home in the morning (x) against my commute time (y) but the x values are wrong - My time values are around 6-7 am but my scattergram includes afternoon times.


I can fiddle about with this and get it looking right but when I add a new pair of data to the chart (most mornings), the x-axis goes silly again.


Any ideas (besides using Excel!) please?



User uploaded file


User uploaded file

iMac, OS X Mavericks (10.9.1)

Posted on Feb 17, 2014 3:48 AM

Reply
9 replies

Feb 17, 2014 5:28 AM in response to Seabeethree

Hi SBT,


It looks like a Scatter Plot:


User uploaded file


If so, it is behaving as it should. It is scaling the X axis as linear, and not showing exact data values as steps.



Or is it a Category Line Chart:


User uploaded file


which treats each X value as a distinct step (but is not linear).



A Scatter Plot requires both X and Y values to be in Body (non Header) columns.

A Category Chart requires X values to be in a Header Column and Y values to be in a Body Column.


Both types of Chart work best when the axis names (leave home and commute time) are in a Header Row.


User uploaded file


The power of Numbers is that it allows several small, discrete tables on the "canvas" of each sheet. Each table has its own function (perhaps to act as the source data for a chart). The data can be pulled from an input table and then formatted to suit the purpose (perhaps with Header Rows and Columns).


Regards,

Ian.

Feb 18, 2014 11:05 AM in response to Seabeethree

SBT,


The explanation is simple, but the fix is more involved.


Numbers has no value type for Time of Day independent of day. It only has Date&Time, the time of day on a particular date. So, a Time entered tomorrow is 24 hours later/greater than the same time entered today. The Date part of a time is always assumed to be the date when the value is entered, unless the full date and time is entered. You can imagine how long your x-axis could become!


Numbers has a function that strips the date from a date&time value, called TIMEVALUE. The result of TIMEVALUE is a decimal portion of a day representing a particular time of day.


You seem to be very capable at spreadsheet work, so I imagine you can take it from here, but we'd be happy to help if you need it.


Jerry

Feb 18, 2014 3:28 PM in response to Seabeethree

Here's a solution that requires very little in the way of setup changes, but some minor data entry changes.


User uploaded file

The "Times" are all actually Durations, and must be entered using the format 7h30m.


The format will automatically change to 7:30, if that is the way you have the cells formatted: hh:mm.


Doing is this way, the math is simple and you don't have to worry about the Dates.


Jerry

Feb 27, 2014 7:17 AM in response to Yellowbox

Hi Ian,

Thanks very much for replying and sorry it's taken me so long to look back at this.


The chart is a 2D Scattergram and the file is an adaptation of the Running Log template. The problem is not really that the x axis is not using the real x data on the scale (actually, it would be nice to have my leave times in, say, neat 2-minute blocks), it's that that the scale depicts impossible leave times - they extend beyond the range of the data.


I wasn't too sure how the headers were set up in this template so I duplicated the chart in a Blank template and made sure that the x/y titles were in proper Header cells. I didn't get lucky here and the scale label weirdness persists.


Best wishes, Jasper


User uploaded file

User uploaded file

User uploaded file

Feb 27, 2014 8:08 AM in response to Jerrold Green1

Thanks JG1 (and sorry for the slow reply),


Re. =TIMEVALUE()


I've got as far as turning my date+time into decimal forms of the date only. Now my 2D Scattergram has those fractional values on its x axis - which is now, at last true, but not intuitive.


If I try to re-format the decimal times (i.e., back to dateless times) nothing happens. Or is there something like, =INVTIMEVALUE() that turns date-stripped decimal times back into proper times.


Re. Using Duration,

THIS WORKED- I tried changing the format of the original leave times but this didn't take (they remained as Date + Time). I keyed these data into a fresh column with the Duration format as you suggested and now have a sensible x axis.


In case you were wondering, it really does seem to be worth leaving the house early to beat the bad traffic! I don't know how pleased to feel about that!


Thanks very much for the reply, Jasper

User uploaded file


User uploaded fileUser uploaded fileUser uploaded file

User uploaded file

Feb 27, 2014 3:52 PM in response to Seabeethree

"it's that that the scale depicts impossible leave times - they extend beyond the range of the data."


Actually, they don't.

The "range of the (x-axis) data" is from February 4, 2014 at 6:45 AM to February 14, 2014 at 6:52 AM, a range of 240 hours and 7 minutes. All data points shown are plotted within that range.


Using either or Badunit's or Jerry's suggestions removes the date difference from the plotted x values. You can also do that by re-entering all of the start and arrival times, and doing all of the new entries on the same calendar day.


Date and Time values (which includes all of the entered values in the bodies of columns A, B and C) always include both a date part and a time part.

If only the date part is entered (as in column A), the time part is set to 00:00:00 (midnight at the beginning of that day and only the date part is displayed.

If only the time part is entered (as in columns B and C), the date part is set to the date on which the entry was made, and only the time part is displayed.

Entering the time parts all on the same calendar day removes the differences in date from the calculations, and from the range to be displayed on the chart.


Regards,

Barry

Mar 3, 2014 5:56 AM in response to Barry

Actually, they don't.

The "range of the (x-axis) data" is from February 4, 2014 at 6:45 AM to February 14, 2014 at 6:52 AM, a range of 240 hours and 7 minutes. All data points shown are plotted within that range.


Yes - I see what you mean. Numbers is picking times at regular intervals between those two dates.


Using either or Badunit's or Jerry's suggestions removes the date difference from the plotted x values. You can also do that by re-entering all of the start and arrival times, and doing all of the new entries on the same calendar day.


I'm adding new data each day so I'll use Badunit's or Jerry's tips.

Thanks everyone for a compehensive answer

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Wrong axis values in Numbers chart

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.