Bug 160522 - Generating Chart with more than 4 columns selecting stock first than column or bar: Only 4 colors
Summary: Generating Chart with more than 4 columns selecting stock first than column o...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0 target:24.8.0.0.beta2 t...
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2024-04-04 15:52 UTC by renoub51@gmail.com
Modified: 2024-06-15 12:37 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
preview with more than 7 columns and only 4 different colors (18.58 KB, image/png)
2024-04-04 15:52 UTC, renoub51@gmail.com
Details
File with data an graphic error (36.35 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-06-12 13:52 UTC, renoub51@gmail.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description renoub51@gmail.com 2024-04-04 15:52:49 UTC
Created attachment 193493 [details]
preview with more than 7 columns and only 4 different colors

First, select more than 4 columns to view in a chart.
While generating a chart, in chart wizard we select first or at any time "Stock chart".
Next, still in the same chart wizard, just with preview chart, without chart, change to chart Column, bar ...
The result is only 4 colors for the columns : the fourth one is cyan and repeated for all last columns.
It failed on versions : windows 1124.2.2.2 and lunbuntu 22.04 7.3.7.2.
Comment 1 m_a_riosv 2024-04-04 23:09:49 UTC
Please attach a sample file, reduce the size as much as possible without private information, and paste the information in Menu/Help/About LibreOffice, there is a copy icon.
Comment 2 renoub51@gmail.com 2024-04-05 17:34:52 UTC
Version: 24.2.2.2 (X86_64) / LibreOffice Community
Build ID: d56cc158d8a96260b836f100ef4b4ef25d6f1a01
CPU threads: 8; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded
Comment 3 renoub51@gmail.com 2024-04-05 17:44:05 UTC
Version: 7.3.7.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 6.2; UI render: default; VCL: qt5 (cairo+xcb)
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Ubuntu package version: 1:7.3.7-0ubuntu0.22.04.4
Calc: threaded
Comment 4 Buovjaga 2024-06-12 11:21:30 UTC
Still waiting for a sample file.
Comment 5 renoub51@gmail.com 2024-06-12 13:52:26 UTC
Created attachment 194681 [details]
File with data an graphic error

Hello,
I send you a basi sample of error color for the graphic generated, with same color for several columns.
Process : start beginning the graphic, while previiew click on all possible optios of graphics and tuen back to the first view option.
Generate the graphic.
See the result inside the .calc file.
Best Regards
B.R.
Comment 6 renoub51@gmail.com 2024-06-12 13:56:47 UTC
One more:
As I preview my calc file, graphic is ok.
You must follow the steps I send you to generate the bug.
Best Regards
Bernard
Comment 7 renoub51@gmail.com 2024-06-12 13:59:59 UTC
I said preview the attach file : I talk about Created attachment 194681 [details] 

If you want a demo of the bug, We can make a visio, it could be more simple.

Best Regard
Bernard
Comment 8 Buovjaga 2024-06-12 16:48:19 UTC
Thanks, I have found out the responsible commit. I will investigate a bit more.
Comment 9 Buovjaga 2024-06-12 17:37:59 UTC
Bibisected with linux-64-7.0 to 337a9a454c1bc95214111578d3f9c0622c55c509
use for-range on Sequence in chart2

The commit changes dozens of files, so it is difficult to figure out which one is relevant. Purely by guessing, I tried reverting the changes to chart2/source/tools/ConfigColorScheme.cxx (involving also a later commit), but it did not get rid of the issue. Probably debugging is needed.

Steps:
1. Open attachment 194681 [details]
2. Click Insert Chart in toolbar, observe the column colours in the preview
3. Click Stock in the chart type list
4. Click back to Column
Comment 10 Buovjaga 2024-06-12 20:19:56 UTC
Did some brute force debugging on the files modified in the commit (first broad strokes with 'rbreak path/to/file:.' for one file at a time) and so far I found this loop is hit when switching from Column to Stock:

https://opengrok.libreoffice.org/xref/core/chart2/source/model/template/ChartType.cxx#205
Comment 12 Noel Grandin 2024-06-14 11:45:46 UTC
buovjaga, so, when I want to track down which part of a larger patch caused a bug, what I do 
(*) first do a revert, and fix up any merging issues. 
(*) Then I make a patch out of the revert (git format-patch -1). 
(*) Then I apply that patch (git apply foo). 
(*) Then I reset half of the files modified. Then I test that. 
(*) Depending on if that works our not, I know which half of patch caused the bug. 
(*) Then I repeat, doing cutting the affected files in half until I find the file that caused the problem. 
(*) Then I reset only part of the file, and repeat until I find the smallest chunk that caused the problem.
Comment 13 Buovjaga 2024-06-14 11:59:00 UTC
(In reply to Noel Grandin from comment #12)
> buovjaga, so, when I want to track down which part of a larger patch caused
> a bug, what I do 
> (*) first do a revert, and fix up any merging issues. 
> (*) Then I make a patch out of the revert (git format-patch -1). 
> (*) Then I apply that patch (git apply foo). 
> (*) Then I reset half of the files modified. Then I test that. 
> (*) Depending on if that works our not, I know which half of patch caused
> the bug. 
> (*) Then I repeat, doing cutting the affected files in half until I find the
> file that caused the problem. 
> (*) Then I reset only part of the file, and repeat until I find the smallest
> chunk that caused the problem.

It sounds good, but in this case there is an insane number of merging issues :)
Comment 14 Commit Notification 2024-06-14 17:03:39 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/013282b1421c0bba66ef54ccbfe4a649a4b97628

tdf#160522 Chart > 4 columns, Only 4 colors

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2024-06-14 20:37:45 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/d186dd8958a5f28abcf6da8af63f8e597861305b

tdf#160522 Chart > 4 columns, Only 4 colors

It will be available in 24.8.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2024-06-14 20:37:48 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/0b0b46770cf97a82c2565269fe293462312aec20

tdf#160522 Chart > 4 columns, Only 4 colors

It will be available in 24.2.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Buovjaga 2024-06-15 12:37:54 UTC
Verified, thanks!

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: cfffcbc39b2c6794eaeddae5134fb59848a76d41
CPU threads: 8; OS: Linux 6.9; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded