Apache OpenOffice (AOO) Bugzilla – Issue 63455
scale dialog shows time values incorrectly
Last modified: 2013-02-24 21:21:42 UTC
1. Create a chart from a spreadsheet with a time y axis 2. open y-axis object properties 3. there are several time values not correctly shown - a negative min value (eg. -3:00:00) is shown as a positive value (21:00:00) - main interval (eg. 1:00:00) is shown decimal as 0,0 - sub interval is shown decimal too
wrong component, changed to Chart. And as far as I remember a double.
confirming all 3 points with 680_m158 on WinXP Pro SP2; possible duplicate for last 2 points: issue 6278
Created attachment 35182 [details] test file
Created attachment 35282 [details] Two charts with different time formats
The first problem has to do with the number format and is somewhat subtle. 1. When you enter a time in a cell, the format is detected and automatically set to a fitting format. When you enter "3:00" the format becomes "HH:MM:SS". If you enter "-3:00" the format gets "[HH]:MM:SS", which displays negative times in contrast to the first format. 2. In the attached example (tya.ods), the first cell has format "HH:MM:SS", as well as all other cells except the one with the negative value, which has "[HH]:MM:SS". 3. When creating a chart out of a range, Calc choses a number format to pass to the chart for being used for the y-axis. This is currently done by taking the first cell of the range. As a result, you get "HH:MM:SS" for the y-axis, which does not show negative times. 4. The scale tab-page uses the format of the y-axis. See the attached DifferentTimeFormats.ods for two examples of charts with the two number formats. In the lower chart, the scale tab page show the time correctly in the Minimum field. In the upper chart it is in principle also the correct format, because the y-axis also shows 21:00 instead of -3:00. Currently, I have no idea how we could smartly fix this. If it were possible to get a "Format that can deal with negative values" for every given format (which at least does not work for user-defined formats), this would help for the chart. Alternatively, Calc could take a more sophisticated approach to find a good number format. With this, you might still get this problem, when all values are positive, but you want to set a minimum of -1:00.
The problems with the major and minor interval would require some functionality like DifferenceFormatFor( anyFormat ). The reason why the values are not shown as expected is the following, Assume you have a number format "Saturday, October 21, 2006". Then, when you want a major step "1 day", you would get "Sunday, December 31, 1899" as major step. You wouldn't want this. So, as I said, for each format there should be a difference format like "1 day 2 hours". As long as we don't have such a thing (again this usually fails at least for user-defined formats), I don't see any good solution for this. Maybe both issues can be fixed especially for time and date formats. But I wouldn't want to do this in the chart but rather in the number formatter implementation.
Created attachment 35320 [details] Step1
Created attachment 35321 [details] Step2
As i can read its not an defect but rather an enhancement. I change the Type.
Checked in a recent version OOo 3.2: The problems within the scale tab page of the axis dialog have been fixed already (see Issue 87900). *** This issue has been marked as a duplicate of 87900 ***
closing duplicate issue