Ask Your Question
0

Make X-axis labels show the dates in the series

asked 2020-04-13 19:07:04 +0200

Jonrysh gravatar image

updated 2020-04-16 18:58:04 +0200

I am building a bar chart of covid-19 cases in CA; the data comes from https://github.com/CSSEGISandData/COV... . The plot is of (X-axis) dates shown in row 1, cells L1:CM1, (Y-axis) cumulative number of cases show in row 63, cells L63:CM63 The chart comes up fine; the Y-axis is labelled properly, but the X-axis simply shows the number of the bar, starting from the left. How do I make the labels of the X-axis show dates taken from row 1?

Here is the spreadsheet containing the chart (Thanks to Opaque): C:\fakepath\CA.ods

edit retag flag offensive close merge delete

Comments

I will be happy to post the data, if anyone can show me how

Jonrysh gravatar imageJonrysh ( 2020-04-13 19:08:20 +0200 )edit

Click the edit pencil right above and use the clip symbol to attach your file image description

Opaque gravatar imageOpaque ( 2020-04-14 19:46:49 +0200 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2020-07-04 18:17:40 +0200

Alex Kemp gravatar image

updated 2020-07-05 18:32:50 +0200

I was suffering the same problem as the OP for many days after converting a “Columns + Line” chart to a “Stacked Columns + Line” chart when, Hey Presto!, all the formatted dates disappeared from the x-axis of the chart immediately after conversion, being replaced by numbers - the exact problem as the OP (see his CA.ods). Nothing I could do seemed to bring it back until I came across @Lupp’s answer on this page. However, I still had to spend a couple of hours trying to decrypt his answer, since I could not make any sense of “It's getting what it is supposed to show from a range tiitled 'Lables' in th rtespective dialog”, so here is an expanded explanation for others as thick as me.

My spreadsheet is set up with:

  • First row contains Headings for the data columns that are below them
  • First column is headed ‘Date’ and contains formatted dates for each row of data to it’s right

Thus, in extreme simplified form, the SS looks like this:

Date   Data1  Data2
Jan 1  12345  abcde
Jan 2  67890  wxxyz

In the middle of using the Chart Wizard we get to use the Data Ranges dialog. Another way to get there is to:

  1. Right-click on an existing Chart and choose ‘Edit’
  2. Right-click on the now-selected Chart & choose “Data Ranges”…
  3. On the first tab of the Data Ranges dialog (Data Range) put a tick✔ within both “First row as label” & “First column as label”
  4. On the second tab of the Data Ranges dialog (Data Series) place your cursor within the “Categories” section
  5. Enter the reference for the entire column of dates, NOT including the Header (eg for myself that is currently “$'2020 Stats'.$A$2:$A$117”, or see Lupp’s chart within the SS in his answer)
  6. Repeat for each Data Series
  7. Press OK

The final item is:

  1. Right-click on an x-axis label & choose “Format Axis…”
        (if the x-axis labels do not show, then right-click on the Chart, then select “X-Axis” in the top drop-down, then click on the “Format Selection” icon next to it (which gets the same dialog as previous), select the “Label” tab and put a tick in “☑Show Labels” & press OK)
  2. On the first tab (“Scale”) you can now choose either “Automatic”, “Date” or “Text”.
        The difference is that “Date” will show an empty column for any missing dates, whereas “Text” will not.

A final shout-out & thank you to @Lupp for showing me how to fix a knotty problem in a simple fashion.

(tested using LO Version: 5.2.7.2 under Devuan Linux 2.1 (ascii))

If this helps then please tick the answer (✔)
...and/or show you like it with an uptick ()

edit flag offensive delete link more
0

answered 2020-04-16 22:20:43 +0200

Lupp gravatar image

C:\fakepath\ask238328columnChartLabels_1.ods
The x-axis of a columnn chart isn't just scale like in a x-y-scatter chart. It's getting what it is supposed to show from a range tiitled 'Lables' in th rtespective dialog.

You sure that after 2022-10-30 everything is over?

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-04-13 19:07:04 +0200

Seen: 62 times

Last updated: Jul 05