How do I add more than one line of data to a graph with numbers from the same column?

I occasionally do glucose curves and was interested in seeing what they would look like graphed together. As you can see on the screenshot, I have one table. The column with the dates has merged cells; the ones with the times and glucose readings do not. I managed to create a chart for each group of readings from November, March, and July separately, but I would like to plot all three lines of data on the same chart but cannot figure out how to do this.

Posted on Jul 7, 2024 8:09 PM

Reply
Question marked as Top-ranking reply

Posted on Jul 8, 2024 4:39 AM

Numbers does not make it easy to do that. Aside from that, I do not think your charts are quite what you think they are. The line chart you are using is a category chart in which the X axis data is just text labels and is evenly spaced on the axis. For instance, if you were charting data for 8:00AM, 5:00PM, 5:01PM, 5:02PM they would be evenly distributed along the axis rather than one point off to the left and then a large gap and then the others clustered on the right. For a true X-Y chart you need to use the scatter chart, the chart icon that has all the + signs.


Then the second problem is that your "times" are either date&time (i.e., they have a date associated with them, they are not just "time of day") or they are text. I cannot tell which from just looking at your screenshot. Either is fine for the line chart but text won't work for a scatter chart and date&time may give odd results for a scatter chart if the dates are unknown or not what you think they are. For charting more than one day's data on the same scatter chart as different series, all of the dates in column B would have to be the same.


Someone may have a better way to make your charts (or a way to rearrange your table to make it easier) but here is one way based on your existing table:

Format column B as text

Add two new columns to your table as shown in the screenshot below



Formula in column E is =TODAY()+TIMEVALUE(B)

Column E is formatted to show the time only

Formula in column F is =C


  1. Make a scatter chart of the first days worth of data (E2:F4 in my example)
  2. Click on "Edit Data References"
  3. Go to the bottom left of the window and click on the arrows next to "plot columns as series" then deselect "Share X values"
  4. Make another series, but use columns B&C (B5:C7 in my example)
  5. While still on the table, grab the colored box for the new series and drag it over to the right so it is on the same columns as series 1
  6. Repeat for ay other days you wish to add
  7. Click Done
  8. With the chart selected you can format all the series at the same time to give them connection lines and reduce the data point size, etc.
  9. If you want the legend to display the dates for each series, select a series on the chart and change which cell has the series "name". You'll have to do that individually for each series.
  10. With the chart selected, go to the "chart" tab in the sidebar and select "show hidden data"
  11. Hide columns E and F. Unhide them when you want to make new charts.



3 replies
Question marked as Top-ranking reply

Jul 8, 2024 4:39 AM in response to TigerSampson

Numbers does not make it easy to do that. Aside from that, I do not think your charts are quite what you think they are. The line chart you are using is a category chart in which the X axis data is just text labels and is evenly spaced on the axis. For instance, if you were charting data for 8:00AM, 5:00PM, 5:01PM, 5:02PM they would be evenly distributed along the axis rather than one point off to the left and then a large gap and then the others clustered on the right. For a true X-Y chart you need to use the scatter chart, the chart icon that has all the + signs.


Then the second problem is that your "times" are either date&time (i.e., they have a date associated with them, they are not just "time of day") or they are text. I cannot tell which from just looking at your screenshot. Either is fine for the line chart but text won't work for a scatter chart and date&time may give odd results for a scatter chart if the dates are unknown or not what you think they are. For charting more than one day's data on the same scatter chart as different series, all of the dates in column B would have to be the same.


Someone may have a better way to make your charts (or a way to rearrange your table to make it easier) but here is one way based on your existing table:

Format column B as text

Add two new columns to your table as shown in the screenshot below



Formula in column E is =TODAY()+TIMEVALUE(B)

Column E is formatted to show the time only

Formula in column F is =C


  1. Make a scatter chart of the first days worth of data (E2:F4 in my example)
  2. Click on "Edit Data References"
  3. Go to the bottom left of the window and click on the arrows next to "plot columns as series" then deselect "Share X values"
  4. Make another series, but use columns B&C (B5:C7 in my example)
  5. While still on the table, grab the colored box for the new series and drag it over to the right so it is on the same columns as series 1
  6. Repeat for ay other days you wish to add
  7. Click Done
  8. With the chart selected you can format all the series at the same time to give them connection lines and reduce the data point size, etc.
  9. If you want the legend to display the dates for each series, select a series on the chart and change which cell has the series "name". You'll have to do that individually for each series.
  10. With the chart selected, go to the "chart" tab in the sidebar and select "show hidden data"
  11. Hide columns E and F. Unhide them when you want to make new charts.



Jul 8, 2024 5:26 AM in response to TigerSampson

Hi Tiger,


Maybe this will move us towards a solution. Row 1 is a Header Row. By reorganising your table and using the TIMEVALUE function, we can ignore the date part of Date & Time and convert the time part to a fraction of a day from midnight. Then we have numeric values for the X axis.



Table 'Time Values' is a duplicate of 'Table 1' with this formula in B2: TIMEVALUE(Table 1::B2)

Fill down, then copy and paste into columns D and F.


Select columns B to G and insert a Scatter Plot.

Click on the graph, click on Edit Data References, deselect Share X Values (Pop-Up Menu, bottom left of the window) to see X Y X Y X Y in the table.



Now we wait for a Numbers guru to show us how to make more sense of the X axis.


Regards,

Ian.

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.

How do I add more than one line of data to a graph with numbers from the same column?

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