Created attachment 175581 [details] A chart with custom colors and a legend When setting custom colors for the data range (fill color), the newly used colors are not used in the legend, where the standard ones are still present. See attachment. Checked present under Linux and Windows (same version, see below). Version: 7.2.0.4 / LibreOffice Community Build ID: 9a9c6381e3f7a62afc1329bd359cc48accb6435b CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3 Locale: fr-FR (fr_FR.UTF-8); UI: en-US Calc: threaded
When I open the attached file in Microsoft Excel, I see the chart open with standard legend colors. When I open the attached file in calc, It shows custom colors on chart and standard ones are in legends. But if I tried to edit and give custom colors on chart I can see the custom colors on legends too. Version: 7.2.2.2 (x64) / LibreOffice Community Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56 CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: threaded Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community Build ID: 542a38de1a071f54f61806683dafea84e43edce9 CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: threaded
The chart colors are set using a range (here: E2:E5). See the Data ranges definition (Edit mode > right click > Data ranges). The Data series tab has values for Border color and Fill color. Note that the Data range tab, Data range box, has a provision for the given colors ranges ($Sheet1.$A$2:$B$5;$E$2:$E$5)) I've tried changing the colors in the color range, to no avail: the data areas change colors but not the legend. Here's the bug, imo. But, when I set the colors directly: 0. Remove the color range (remove the ;$E$2:$E$5 part in the Data rage spec, then remove the Fill colors and Border colors values) 1. Select the data points one by one 2. Set their colors by Right-Click > Format data point then the new colors are correctly propagated to the legend. This shows the bug, I'd say. The user wants to automate the colors setting by specifying a "color palette" she sets somewhere in the sheet (here E2:E5). Version: 7.1.3.2 / LibreOffice Community Build ID: 47f78053abe362b9384784d31a6e56f8511eb1c1 CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3 Locale: fr-FR (fr_FR.UTF-8); UI: en-US Calc: (but present in former versions)
https://opengrok.libreoffice.org/xref/core/chart2/source/view/charttypes/VSeriesPlotter.cxx?r=5b0ae3b5&fi=createLegendEntriesForSeries#2642
https://opengrok.libreoffice.org/xref/core/chart2/source/controller/dialogs/tp_DataSource.cxx?r=5b0ae3b5#803 I haven't looked further into the code, but it seems I have to know the difference between "Series" and "Roles".
https://opengrok.libreoffice.org/xref/core/chart2/source/view/charttypes/PieChart.cxx?r=5b0ae3b5#836
Sub Main() Dim X() As Integer A: Redim X(1) Goto C: ' Probably While runtime gotes to C, Parser goes to B, not C. B: X(1,1) = 3 Exit Sub C: Redim X(1,1) Goto B: End Sub
Oops, posted on wrong report.
(In reply to Jean-Francois Nifenecker from comment #2) > The chart colors are set using a range (here: E2:E5). See the Data ranges > definition (Edit mode > right click > Data ranges). The Data series tab has > values for Border color and Fill color. Note that the Data range tab, Data > range box, has a provision for the given colors ranges > ($Sheet1.$A$2:$B$5;$E$2:$E$5)) > > I've tried changing the colors in the color range, to no avail: the data > areas change colors but not the legend. Here's the bug, imo. I tested by removing the .$E$2:$E$5 from the Fill Color. Already seen in oldest of 44max bibisect repo on Linux. In earlier versions the chart doesn't use the colours at all. Stéphane found a duplicate, so let's close this one. *** This bug has been marked as a duplicate of bug 96332 ***