11

I have a chart with dates along the X axis, but the chart displays them quite close together, producing a rather ugly graph. How might I reduce the number of visible labels to increase the readability a little?

enter image description here

Edit: Sheet in question https://docs.google.com/spreadsheets/d/1P4sTn6YOp_747Gc5nCF34af1MN3AjhO0wRj85FjAqkA/edit?usp=sharing

Rubén - Volunteer Moderator -
  • 46,305
  • 18
  • 101
  • 297
Dr-Bracket
  • 213
  • 1
  • 2
  • 7

4 Answers4

4

Answer:

... -> Edit chart -> Customize -> Gridlines -> Horizontal Axis (in drop down) -> Major gridline count

Under the Major gridline count you can select or type however many dates you want to see on the horizontal label here, for auto mine shows up with a reasonable number of dates but if you wanted to see 20 dates or 10 dates you can type 20 or 10 here respectively.

Note: if you do not see Horizontal Axis under gridlines you need to go to

Customize -> Vertical axis

make sure Treat labels as text is unchecked.

in your specific example dd-mm-yyyy is not a recognized 2014-04-24 date format so use the following formula to fix that, paste in cell F1 for example :

={"DateFormat";arrayformula(if(B2:B="","",date(index(split(B2:B,"-"),,3),index(split(B2:B,"-"),,2),index(split(B2:B,"-"),,1))))}

(make sure to Format->Number->Date on this entire new column F)

Bonus: Depending on how you want to present the data you can also create a fake label column to display important dates you want in various ways.

For example you can put this formula in G1 in conjunction with the note above

={"NotedDates";arrayformula(if(E2:E="","",F2:F))}

which will create a list of dates you can use as a text label to only display important dates, however with the amount of points you have in your data you have to stretch the chart out way larger than the web page to be able to display that information because google sheets is randomly deciding which label to omit because of size constraints.

CodeCamper
  • 867
  • 5
  • 7
2

Following the advice of CodeCamper's answer above, I spent some time playing around with settings like "treat labels as text" to no avail. My issue was that no matter what I did, "major gridline count" never showed up, and I could only see an option for ticks:

cropped screenshot of Google Sheets - Chart editor > Customize > Gridlines and ticks > Horizontal axis - no gridline options visible

Eventually I found a workaround for a related issue that also fixed my problem at this link: https://support.google.com/docs/thread/2577719/can-t-set-horizontal-min-max-on-chart-when-data-is-dates

Basically, the workaround is to format the data first as a generic number (highlight spreadsheet column, Format > Number > Automatic), which looks like it satisfies some condition for Google Sheets and then it will show the gridline options. Once you're done setting those up as desired, you can go back to the spreadsheet and reformat the dates as desired. I did this and my formatting options were persistent even after switching back to yyyy/mm/dd format.

Michael
  • 21
  • 2
0

Move around the columns on the "setup" tab of the chart such that the x-axis is the right data, and there is only one column for the "series."

Change the chart to be a simple "column chart." Check the "use column A as labels" box (column A are dates for the horizontal axis in my case) and uncheck "treat labels as text."

Blindspots
  • 7,737
  • 5
  • 20
  • 39
0

Setup > X-Axis >> Remove AGGREGATE

(and...)

Setup > X-Axis >> Use COLUMN [Date] AS LABELS

Setup > X-Axis >> Remove TREAT LABELS AS TEXT