Bug 163715 - X-Y Scattergraph "Data series in rows" fails to add correct Y error bars from field
Summary: X-Y Scattergraph "Data series in rows" fails to add correct Y error bars from...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
7.3.7.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-01 14:35 UTC by nats.nmr
Modified: 2025-02-27 13:07 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
A demo file to test the issue with, including a "correct" answer for comparison (61.97 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-11-01 14:35 UTC, nats.nmr
Details
Reduced sample file to test with. (32.10 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-11-03 14:50 UTC, LeroyG
Details
Sample file to test with, including some explanations. (65.93 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-02-25 20:29 UTC, LeroyG
Details
Sample file to test with, including some explanations (correct version). (86.23 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-02-25 21:49 UTC, LeroyG
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nats.nmr 2024-11-01 14:35:17 UTC
Created attachment 197336 [details]
A demo file to test the issue with, including a "correct" answer for comparison

If one has one has an X-Y scatter graph and needs to change the data source from the default “Data Series in rows” to “Data Series in columns” and one is supplying calculated Y-error bars, then using (Menu Bar) → Insert → Y-Error Bars 
 and selecting the appropriate field for the error bar values creates a graph with incorrect error bars.  The right values might be present but then they are assigned to the wrong data points in the graph.  I haven't done any tests to confirm, but my untested hypothesis is that it seems to only add in the Error bar data in rows and thus is in transpose relative to the data series it is sampling which means the same dynamic source tables I use to calculate the data for these graphs and the error bar layout cannot be used without transposing one of them and generally making the situation so complicated I have never gotten it to work correctly.

I have gotten others to confirm this when initially asking for help about this (assuming I was just doing it wrong) on the "ask Libre" site.  For the potentially relevant discussion see here: https://ask.libreoffice.org/t/complex-x-y-scatter-graph-error-bar-challenges/113101  One of the people there LeroyG, confirmed the issue, but said it did work properly in their hands, if and only if, they added only a single row of error bar data.  Multiple rows caused mis-assignment of the error bars to their corresponding data or whatever is going on here that produces the wrong error bars.

I have no idea if this is also true of X-Error bars, I haven't tried it.  But assuming they rely on a good deal of the same underlying code there is likely the same issue there too.

I have attached a useful test file as it has the "right answer" as well as the whole graph minus error bars just below it so that one can assign error bars to it to see the results.  The "right answer" can be obtained only (at least by my ability to tell) by laboriously manually selecting each and every data series and manually assigning it a single row of Y-error bars.  Anything else I can figure out how to do produces errors with the error bars.  Below are instructions for the file:

“Errorbar_graph_example.ods” Here is the description so people can test things:

-one tab “Example Processed”

-Table “Graph values” at top left (start at cell B2) has the actual values for the data series of the graph. I have made them static for simplifying this example file but they used to be dynamic based on processing between 3 much larger tables.

-Table “Y-error bars” to the right of the above (start at cell R2) has the values for the Y-error bars to be added to the graph. These are a single set of errors, i.e. “positive values = negative values” which is how they should be added to the graph. This table has also been made static for simplifying this example file but was formerly dependent on number of larger tables.

-Graph “How Graph Should look (manually “click” added Y-error bars)” starts at Cell B21. This graph and its error bars are correct because each data series was individually selected and the error bar series was manually added to each one.

-Graph “Try Adding the error bars in a single step to this graph” starts at Cell B57. This graph is the example graph. It has the structure, source data, scale, etc… of the graph above, but no error bars have been added to this graph. How does one add error bars to this graph in a single step as opposed to laboriously clicking on each of the series zooming in and struggling to with the more difficult to reach ones?

I can select the “Try Adding the error bars in a single step to this graph” graph. Edit it. Do Menu->Insert->Y Error Bars… and select the values on the “Y-error bars” table. This adds error bars to this graph BUT THEY ARE WRONG!!!. One can check this by looking at the “How Graph Should look (manually “click” added Y-error bars)” and see that these may be the right values but they have been added to the wrong points on the graph.  THE EASIEST BY EYE QUICK CHECK FOR CORRECT ERROR BARS is the nice flat “Media and Cells” data series has all the same sized error bars as one can see both in the table and the "correct" example graph.  If one adds error bars to the experiment graph and the “Media and Cells” data series ends up with error bars that are not all the same size, then something is wrong (as it usually is every time I or others do this without manually adding Y-error bars for each data series separately.)
Comment 1 LeroyG 2024-11-03 14:50:25 UTC
Created attachment 197375 [details]
Reduced sample file to test with.

Chart values are set by rows.

When Y Error Bars values are added in one step (menu Insert - Y Error Bars - Cell Range) each X value of all series use the same Y error bars values.

The Y error bars values are taken from each cell of the range first column, then from the following column's cell/s.

If the Y Error Bars range is:
· A1:A4 (one column), values are taken in this order: A1, A2, A3, A4.
· A1:D1 (one row), values are taken in this order: A1, B1, C1, D1.
· A1:B2 (bidimensional), values are taken in this order: A1, A2, B1, B2 (in the sample file: K3:N4).

Tested with:
Version: 24.2.7.2 (X86_64) / LibreOffice Community
Build ID: ee3885777aa7032db5a9b65deec9457448a91162
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: es-MX (es_ES); UI: en-US
Calc: CL threaded
Comment 2 LeroyG 2024-11-03 23:22:19 UTC
Reproducible with:

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 4; OS: Linux 5.14; UI render: default; VCL: gtk3
Locale: es-MX (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 3 Buovjaga 2025-02-25 15:08:44 UTC
(In reply to LeroyG from comment #1)
> Created attachment 197375 [details]
> Reduced sample file to test with.

Can you explain what is shown? Which chart has the correct and which one the incorrect result?
Comment 4 LeroyG 2025-02-25 20:29:22 UTC
Created attachment 199445 [details]
Sample file to test with, including some explanations.

(In reply to Buovjaga from comment #3)
> Can you explain what is shown? Which chart has the correct and which one the
> incorrect result?

In the file I attached to comment #1, there was errors in the ranges of the description in cells J6 and J7. I have corrected it in the new attachment.

See the new attachment, one sample chart in each sheet.

Version: 24.2.7.2 (X86_64) / LibreOffice Community
Build ID: ee3885777aa7032db5a9b65deec9457448a91162
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: es-MX (es_ES); UI: en-US
Calc: CL threaded
Comment 5 LeroyG 2025-02-25 21:49:54 UTC
Created attachment 199447 [details]
Sample file to test with, including some explanations (correct version).

Sorry, previous attachment was made before saving the last changes in the file.
Comment 6 Buovjaga 2025-02-26 11:40:36 UTC
(In reply to LeroyG from comment #5)
> Created attachment 199447 [details]
> Sample file to test with, including some explanations (correct version).

What does "added in a single step (automatically)" mean?
Comment 7 LeroyG 2025-02-26 13:11:22 UTC
(In reply to Buovjaga from comment #6)
> (In reply to LeroyG from comment #5)
> > Created attachment 199447 [details]
> > Sample file to test with, including some explanations (correct version).
> 
> What does "added in a single step (automatically)" mean?

Not serie by serie, but for all (both in the sample) data series at once. See the range in the dialog screenshot included in each sheet.
Comment 8 Buovjaga 2025-02-26 13:50:44 UTC
(In reply to LeroyG from comment #7)
> (In reply to Buovjaga from comment #6)
> > (In reply to LeroyG from comment #5)
> > > Created attachment 199447 [details]
> > > Sample file to test with, including some explanations (correct version).
> > 
> > What does "added in a single step (automatically)" mean?
> 
> Not serie by serie, but for all (both in the sample) data series at once.
> See the range in the dialog screenshot included in each sheet.

I tried to experiment it earlier, but could not really get it. Do you mean saying H3:K4 instead of H3:K3? It would be good to have very practical steps.
Comment 9 LeroyG 2025-02-26 21:01:39 UTC
(In reply to Buovjaga from comment #8)
> It would be good to have very practical steps.

Steps to reproduce:
0. Open attachment 199447 [details].
1. Copy content of A1:K4 and paste in a new spreadsheet.
2. Select A2:E4 and choose menu Insert - Chart - XY (Scatter) - Lines Only (could be other subtype), Next, (·) Data series in rows, [x] First row as label, [x] First column as label, Finish.
3. Edit the chart.
4. Choose menu Insert - Y Error Bars, (·) Cell Range, select H3:K4 range for Positive (+), OK

Actual result:
H3 is the error bar value for B3 and B4
H4 is the error bar value for C3 and C4
I3 is the error bar value for D3 and D4
I4 is the error bar value for E3 and E4

You can delete cell content of J3:K4, and it would not affect the chart.

Expected result:
H3 is the error bar value for B3 (actual result)
I3 is the error bar value for C3
J3 is the error bar value for D3
K3 is the error bar value for E3
H4 is the error bar value for B4
I4 is the error bar value for C4
J4 is the error bar value for D4
K4 is the error bar value for E4

Tested with:
Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 4; OS: Linux 5.14; UI render: default; VCL: gtk3
Locale: es-MX (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 10 Buovjaga 2025-02-27 13:07:42 UTC
(In reply to LeroyG from comment #9)
> (In reply to Buovjaga from comment #8)
> > It would be good to have very practical steps.
> 
> Steps to reproduce:
> 0. Open attachment 199447 [details].
> 1. Copy content of A1:K4 and paste in a new spreadsheet.
> 2. Select A2:E4 and choose menu Insert - Chart - XY (Scatter) - Lines Only
> (could be other subtype), Next, (·) Data series in rows, [x] First row as
> label, [x] First column as label, Finish.
> 3. Edit the chart.
> 4. Choose menu Insert - Y Error Bars, (·) Cell Range, select H3:K4 range for
> Positive (+), OK

Thanks. I found a new regression causing the bars to not appear at all: bug 165491