Bug 159550 - Automatic low-high right y-axis range is sometimes zero-based even with negative values (stockchart3)
Summary: Automatic low-high right y-axis range is sometimes zero-based even with negat...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.6.4.1 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-04 14:19 UTC by gekacheka
Modified: 2024-02-23 13:19 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
stockchart3-right-axis-range-bug-data.ods produces range 0.0 - 16.0 (15.31 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-02-04 14:19 UTC, gekacheka
Details
stockchart3-right-axis-range-bug-image.png shows right y axis 0.0 - 16.0 (47.79 KB, image/png)
2024-02-04 14:22 UTC, gekacheka
Details
stockchart3-right-axis-range-bug-chart.ods (right y-axis is set by create, not open) (23.94 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-02-05 12:38 UTC, gekacheka
Details
Screnshot Options tab (191.00 KB, image/png)
2024-02-06 01:36 UTC, m_a_riosv
Details
stockchart3-right-axis-range-bug-range-series-dialog.png (77.41 KB, image/png)
2024-02-06 11:43 UTC, gekacheka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gekacheka 2024-02-04 14:19:24 UTC
Created attachment 192380 [details]
stockchart3-right-axis-range-bug-data.ods produces range 0.0 - 16.0

Amount and low-high range chart (stockchart3) sometimes produces an automatic low-high y-axis range on the right that starts from zero even though some values are negative.

If there are negative values, the automatic range lowest value is zero and the chart does not show the negative values.

Steps to reproduce:

1. open stockchart3-right-axis-range-bug-data.ods
2. select $A$1:$D$15
3. menu: Insert / Chart ...
4. Chart type: Stock / Stock Chart 3
5. button: Finish

Actual Result:

Right scale is 0 to 16 even though temperature data range is -15 to 5.

Expected result:

Right axis range is -15 to 5, or -16 to 6, or -20 to 10.

6. Right click on right axis, select "Format Axis ..."
7. In "Secondary Y Axis" dialog, select "Scale" tab.

Actual result:

Must scan data to find minimum and maximum values, and manually set scale minimum and maximum values.

Expected result:

Ability to Choose value type and range will be automatically recalculated.

  Low-High range value type
   (*) 'Ratio' (compares amounts of zero or more, may use log scale)
   ( ) 'Interval' (compares positions, may not use log scale)

Request ability to change the range type to 'interval' values, such as temperatures.  

(A column of 'ratio' values represents a nonnegative amount, such as a length or volume.  The ratio between these amounts can be visualized in pie chart or stacked bar chart.  A column of 'interval' values represents a position that may be negative, zero, or positive, such as temperature or latitude.  These positions can be compared on a line or scatter chart.)

(Terminology of value types including 'Ratio' and 'Interval'
 https://www.geeksforgeeks.org/data-mining-data-attributes-and-quality/  )
Comment 1 gekacheka 2024-02-04 14:22:58 UTC
Created attachment 192382 [details]
stockchart3-right-axis-range-bug-image.png shows right y axis 0.0 - 16.0
Comment 2 gekacheka 2024-02-04 14:34:17 UTC
bug 159419 attachment 192211 [details] shows that stockchart3 can sometimes automatically produce a right y-axis range with negative values.  (It was produced from data in attachment 192210 [details].)
Comment 3 m_a_riosv 2024-02-04 22:56:43 UTC
Sample file has no chart.

Can you attach it with the wrong chart.
Comment 4 gekacheka 2024-02-05 12:38:09 UTC
Created attachment 192410 [details]
stockchart3-right-axis-range-bug-chart.ods (right y-axis is set by create, not open)

This file was produced by following the steps to reproduce, then saving the file.

Note that changing the data does not change the right y-axis.  So this bug seems to be in code that creates the chart.  So opening this file with the chart does not show whether the code that creates the chart is fixed.  The steps-to-reproduce are needed to reproduce the bug.

(I'm assuming that fixing it so changing the data also updates the right y-axis is fixing a separate bug.)
Comment 5 m_a_riosv 2024-02-05 16:52:53 UTC
Let's try
1- Create the chart with the wizard, select the type and finish.
2- Double-click to edit the chart.
3- Double-click on x-axis, on [Positioning], select for 'place labels' 'outside star', Ok.
4- Double-click on 'Hi' and 'Lo' series, on [Options], select 'Secondary y-axis', and 'Show bars side by side'.

Double-click on axis and you can select a logarithmic scale.
Comment 6 gekacheka 2024-02-06 01:09:11 UTC
> Double-click on axis and you can select a logarithmic scale. [comment 5]

I think this misunderstands (or comments on the wrong bug).  

This bug (bug 159550) is about the range automatically chosen for the right y-axis for the given spreadsheet data.  

"Right scale is 0 to 16 even though temperature data range is -15 to 5."

(In the radio-button control for "Ability to choose value type", I wrote "may not use log scale", because in this case the temperature data include both positive and negative values, so the range includes 0.  But a logarithmic axis scale cannot include value 0.    There is no e such that 10^e == 0.)


> Double click on 'Hi' and 'Lo' series

(If still relevant, can you clarify what to click?
 I tried double clicking on a light blue range bar created from the Hi and Lo values, but its Option tab does not have the option "Show bars side by side".)
Comment 7 m_a_riosv 2024-02-06 01:36:41 UTC
Created attachment 192416 [details]
Screnshot Options tab

Please take a look.

For me the wizard doesn't create the Y-secondary axis, so Y-axis is created from the first column data kWh, no negative values.
Comment 8 gekacheka 2024-02-06 11:43:26 UTC
Created attachment 192430 [details]
stockchart3-right-axis-range-bug-range-series-dialog.png

When I right click on a light-blue vertical range line and click "Format data series", I get the dialog shown here. 

> For me the wizard doesn't create the Y-secondary axis

I was not able to reproduce the behavior you reported:  The steps to reproduce create the chart with the secondary Y-axis for me, and this bug is about how it creates that axis with the wrong automatic range.  

(I'm guessing that I do not get the dialog you reported because I don't get the same chart to start with.  Mine has the secondary y-axis.)
Comment 9 Buovjaga 2024-02-23 13:19:22 UTC
(In reply to gekacheka from comment #8)
> Created attachment 192430 [details]
> stockchart3-right-axis-range-bug-range-series-dialog.png
> 
> When I right click on a light-blue vertical range line and click "Format
> data series", I get the dialog shown here. 
> 
> > For me the wizard doesn't create the Y-secondary axis
> 
> I was not able to reproduce the behavior you reported:  The steps to
> reproduce create the chart with the secondary Y-axis for me, and this bug is
> about how it creates that axis with the wrong automatic range.  
> 
> (I'm guessing that I do not get the dialog you reported because I don't get
> the same chart to start with.  Mine has the secondary y-axis.)

It sounds like it would help, if you recorded a screencast of how you do it and attached to the report.