Bug 54132 - Date formatted X-axis only supported for some chart types
Summary: Date formatted X-axis only supported for some chart types
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
(earliest affected)
3.4.0 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
: 131982 155867 (view as bug list)
Depends on:
Blocks: Chart-Labels
  Show dependency treegraph
Reported: 2012-08-27 21:12 UTC by Nils Smeds
Modified: 2023-06-21 10:29 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:

Example of well and badly formatted axes label for dates (33.46 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-08-27 21:12 UTC, Nils Smeds
example of workaround for month axis in XY chart (19.12 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-07-10 10:04 UTC, docfound.bugs.meer
Axis as shown in calc (8.32 KB, image/png)
2022-11-30 17:58 UTC, Julian Sikorski
Axis as shown in SAS (8.83 KB, image/png)
2022-11-30 17:59 UTC, Julian Sikorski
Example of Date to be plotted in xy-plot with dates on x-axis (23.39 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-06-21 10:01 UTC, Martha

Note You need to log in before you can comment on or make changes to this bug.
Description Nils Smeds 2012-08-27 21:12:14 UTC
Created attachment 66191 [details]
Example of well and badly formatted axes label for dates

When creating a graph in LibreOffice sensible formatting of major/minor data labels is only supported for Bar graphs. That is, a simple bargraph can be created where the data labels are eg. the 1st of each month. For other graphs, such as line graphs or other XY graphs it is not possible to get labels on e.g. monthly or yearly basis (when leap years are included in the data set). Only workaround I have seen is to manually enter user labels on the graph.

It would be nice to have the option to configure any axis in any graph to be of special type such as date and be able to format the appearance of the axes accordingly.

In the attached example notice that double clicking the X-axes and looking at the Scale tab of the Format pop-up the chart has an option to use a Date type and select major/minor interals accordingly whereas the xy line graphs can not do that.

Comment 1 Joel Madero 2012-10-19 19:34:33 UTC
Confirmed. Steps:

Download sheet attached
Select data
Insert - Chart
Chart Type - Column
Click Finish
Right click on X Axis Label (one of the dates)
Click "Format Axis..."
On Scale Tab, you'll see "Type" and you can select different types with options

Do the same with a line chart, you'll see that the options are not there. 

Enhancement request, medium

Medium- our charts should behave the same way. Not any higher than medium because I don't think a lot of people even use this feature (first time for me :) ).

ProposedEasyHack as the code should be there and can be modeled by looking at how column chart is done.
Comment 2 Markus Mohrhard 2013-01-24 15:56:23 UTC
Not an easy hack.

Chart2 code is one of the places that is horribly complicated and a endless source for confusion and regressions. Especially the date axis handling is quite non-intuitive.

I'd prefer if we won't mark chart2 bugs as ProposedEasyHacks because we have nobody who is confident enough to throw some code pointers into a bug report.
Comment 3 Owen Genat (retired) 2014-01-09 05:12:29 UTC
Summary amended for clarity and so it shows up more readily in searches.
Comment 4 docfound.bugs.meer 2017-07-10 10:04:13 UTC
Created attachment 134572 [details]
example of workaround for month axis in XY chart
Comment 5 docfound.bugs.meer 2017-07-10 10:15:29 UTC
I attached an example of a workaround with these settings:
Major interval: 61 (days)
Minor interval count: 2
Numbers format code: YYYY-MM (no days)
Interval marks, Minor: yes

This results in an interval mark for each month (every 30.5 days) with a label every second month.
Comment 6 Nils Smeds 2017-07-11 09:20:49 UTC
The workaround is easier than adding manual tick labels, but at the cost of tick labels not appearing at the correct position. The skew is almost one day per year, and occasionally larger, for instance March 1 will be several days off.

In the long run a more general take is probably needed for intervals such as years and months and perhaps also supporting other calendars than western European.

Unfortunately I am not able to volunteer within any time soon.

Comment 7 Regina Henschel 2017-10-14 16:39:00 UTC
Discussion about date scales in ODF is in https://issues.oasis-open.org/browse/OFFICE-2119 and currently on the TC mailing list.
Comment 8 m.a.riosv 2020-04-09 11:19:22 UTC
*** Bug 131982 has been marked as a duplicate of this bug. ***
Comment 9 Julian Sikorski 2022-11-30 17:58:19 UTC
Created attachment 183921 [details]
Axis as shown in calc
Comment 10 Julian Sikorski 2022-11-30 17:59:25 UTC
Created attachment 183922 [details]
Axis as shown in SAS

I would also be interested in having the proper date axis supported. I have generated a similar graph in SAS for an example how this could look like.
Comment 11 Martha 2023-06-21 10:01:27 UTC
Created attachment 188035 [details]
Example of Date to be plotted in xy-plot with dates on x-axis

The problem is still not solved in Version I have attached a sample file. See also https://bugs.documentfoundation.org/show_bug.cgi?id=155867
Comment 12 Stéphane Guillou (stragu) 2023-06-21 10:10:47 UTC
*** Bug 155867 has been marked as a duplicate of this bug. ***
Comment 13 Stéphane Guillou (stragu) 2023-06-21 10:29:25 UTC
This started with Ingrid Halama's work on adding date axes in LO 3.4. In OOo 3.3, there were no settings whatsoever available for date axes.


Relevant commits can be found with:

git log --author="Ingrid Halama" --grep="date"