Bug 80303 - UI: Property mapping - the legend should reflect this possibility
Summary: UI: Property mapping - the legend should reflect this possibility
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 89257 (view as bug list)
Depends on:
Blocks: Chart-Legends 100586
  Show dependency treegraph
 
Reported: 2014-06-20 18:54 UTC by pierre-yves samyn
Modified: 2024-09-23 17:50 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Calcfile with simple Pie-Chart (17.77 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-02-10 10:12 UTC, karolus
Details
Chart Color Assign example to support comment 5&7 (35.78 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-04-13 20:47 UTC, bugzilla
Details
The chart with wrong legend colors (42.01 KB, image/png)
2023-06-18 18:21 UTC, amathieux595
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pierre-yves samyn 2014-06-20 18:54:26 UTC
Hi

Sorry I can't find a good summary...

Platform : windows 7/64 & Version: 4.3.0.1
Build ID: 67f5430184326974072b65403ef1d9d934fc4481

4.3 Added property mapping functionality (nice feature, thank you)
but it seems to me that the legend should reflect this possibility

In the attached example (attachment 101450 [details]) the Val3 series is set in red or green if the value> 5. The legend  keeps the default color when creating the chart.

Of course the legend cannot display all the colors.

I don't know what could be the best improvement
(default no color, remove the point of legend ...)?
Should perhaps ask to UX list?

Regards
Pierre-Yves
Comment 1 Markus Mohrhard 2014-06-22 01:23:54 UTC
Please put me into CC of the property mapping bugs. I'm still working on the feature so they might help me shape the feature before the final release.

For this specific issue I think there is no perfect solution. With the latest changes just pushed to master the series color is now used again when no value is specified in the data range for the mapping. So maybe it still makes sense to include the series color in the legend.
Comment 2 Robinson Tryon (qubit) 2015-02-02 19:13:57 UTC
(In reply to Markus Mohrhard from comment #1)
> For this specific issue I think there is no perfect solution. With the
> latest changes just pushed to master the series color is now used again when
> no value is specified in the data range for the mapping. So maybe it still
> makes sense to include the series color in the legend.

Sounds like there's not much for QA to do here, so
Status -> NEW

(toss back as appropriate)
Comment 3 karolus 2015-02-10 10:12:56 UTC
Created attachment 113286 [details]
Calcfile with simple Pie-Chart
Comment 4 raal 2015-02-10 10:18:07 UTC
*** Bug 89257 has been marked as a duplicate of this bug. ***
Comment 5 bugzilla 2015-04-10 19:03:46 UTC
I've just been caught with this bug which affects a fairly fundamental chart feature.

It detracts from the usefulness of the "Range for Fill Color", since you have to  manually edit the data series colours to force the legend colours to be the same.

I can see instances where this syncing might not be wanted e.g. where you only want to highlight when a value has exceeded some limit, but I think in general the default should be for the legend to track the "Range for Fill Color" values.

Checked on LO 4.4.0.3 Win7
Comment 6 Markus Mohrhard 2015-04-13 19:52:02 UTC
(In reply to bugzilla from comment #5)
> I've just been caught with this bug which affects a fairly fundamental chart
> feature.
> 
> It detracts from the usefulness of the "Range for Fill Color", since you
> have to  manually edit the data series colours to force the legend colours
> to be the same.
> 
> I can see instances where this syncing might not be wanted e.g. where you
> only want to highlight when a value has exceeded some limit, but I think in
> general the default should be for the legend to track the "Range for Fill
> Color" values.
> 
> Checked on LO 4.4.0.3 Win7

How to do that? There is no single color and the color might change any time. Additionally if you have one data point without value in the fill color range the original color is used. For now I don't see this as an important issue. If there is a good design and UX solution I might consider implementing that but until then I consider the current behavior as the best one. If you just want to use one color for all data points just change the series color.
Comment 7 bugzilla 2015-04-13 20:47:49 UTC
Created attachment 114766 [details]
Chart Color Assign example to support comment 5&7
Comment 8 bugzilla 2015-04-13 20:52:01 UTC
Perhaps I've not explained my thoughts well.

My earlier comment-5 relates to pie and stacked bar charts where particuar color assignment is important.  By using the "Range for Fill Color" feature it's straightforward and repeatable to get exactly the colors one wants (except that one has to manually edit the series colors to get the legend to match).

The shortcoming with manually assigning series colours is that you have to do it for each series, and if you delete then re-create a chart you have to start all over with the color assignments. Using the "Range for Fill Color" feature means all one's color info is contained with the source data and ready to apply in one go.

I've added attached Chart_Colour_Fill.ods to illustrate how I'm thinking.

Regards,
Allan
Comment 9 Markus Mohrhard 2015-04-14 18:02:38 UTC
(In reply to bugzilla from comment #8)
> Perhaps I've not explained my thoughts well.
> 
> My earlier comment-5 relates to pie and stacked bar charts where particuar
> color assignment is important.  By using the "Range for Fill Color" feature
> it's straightforward and repeatable to get exactly the colors one wants
> (except that one has to manually edit the series colors to get the legend to
> match).
> 
> The shortcoming with manually assigning series colours is that you have to
> do it for each series, and if you delete then re-create a chart you have to
> start all over with the color assignments. Using the "Range for Fill Color"
> feature means all one's color info is contained with the source data and
> ready to apply in one go.
> 
> I've added attached Chart_Colour_Fill.ods to illustrate how I'm thinking.
> 
> Regards,
> Allan

I completely understand what you want but I see the bigger picture and not just this one use case. There is no solution that works across the different use-cases so I prefer the current solution.
Comment 10 bugzilla 2015-04-15 11:03:50 UTC
On reflection, I was being presumptuous in suggesting a change to the default action.

Would you consider a compromise? In essence an enhancement.

For example, provide a check-box adjacent to the Data Series > Range for Fill Color box, called something like "Synch Legend to Range for Fill Color values". The box would be greyed-out ff the Range Fill was empty.

If left un-checked the current action would prevail.
If checked, the legend colours would synch with the "Range for Fill Color" values (or default to auto if cell empty).

The coding for this would not be trivial, but it would be a very useful and logical feature.

Regards,
Allan
Comment 11 gazhay 2015-05-10 20:32:42 UTC
Just been playing with pie charts and stacked bar charts in 4.4.2.2

Stacked bar charts can use the 'range for color' feature, however all variants of pie chart completely ignore any custom colors.

Only way to change color is to edit a data point, you cannot even edit a whole range.
Comment 12 QA Administrators 2016-09-20 09:42:43 UTC Comment hidden (obsolete)
Comment 13 pierre-yves samyn 2016-09-21 06:43:26 UTC
Hi

Still reproduced on windows 7/64 & Version: 5.2.1.2
Build ID: 31dd62db80d4e60af04904455ec9c9219178d620
CPU Threads: 2; OS Version: Windows 6.1; UI Render: default; 
Locale: fr-FR (fr_FR); Calc: group

Regards
Comment 14 Wolfgang Jäger 2016-12-02 16:40:02 UTC
Also reproduced with V5.2.2 on Win 10.
Comment 15 Wolfgang Jäger 2016-12-03 17:37:20 UTC
I still do not clearly understand the different "use cases" Markus Mohrhard mentioned. Let me try:

As far as I can see the "property mapping" (That is assigning color values to specific elements of a chart via "Range for ... Color" - or something else?) 
is only available on the level of data points. 
The coloring of data series is not supported by the feature.

On the other hand the legend of the chart will address the series for some types and the data points ONLY(?) for pie type and its subtypes and for stacked bars/columns. And ONLY for PIE charts the legend will address the data points instead of the series. Ok. There must be different methods for preparing and inserting the legends. Obviously legends addressing the data points should also mirror the mapped properties. Thus pie charts should do this and all the other charts should not. In addition the legend showing a color per series should be omitted where the actual coloring is done by property mapping. The series color is useless at least. I think it's misleading.

During my tests there was a reproducible case where a line chart (NOT 'Scatter'!) created by changing the type from pie to line remembered the mapped 'Fill' colors despite the fact that it had only tiny areas to fill and there was no editor for the range of color values.  
  
What about donut charts? More than one series can be colored here differently by property mapping, but the legend is based on only one of them. 

"Seeing the bigger picture" might require to specify the behavior of a new feature and to check for probable inconsistencies. If the problems cannot be mastered the feature might better not be implemented.
Comment 16 riesslibo 2017-05-30 14:14:11 UTC
Still present and confirmed for 

Version: 5.3.3.2
Build-ID: 3d9a8b4b4e538a85e0782bd6c2d430bafe583448
CPU-Threads: 8; BS-Version: Windows 6.1; UI-Render: Standard; Layout-Engine: neu; 
Gebietsschema: de-DE (de_DE); Calc: single
Comment 17 Gessel 2017-12-12 22:20:37 UTC
Still a bug for 5.4.3.2 Linux
Comment 18 QA Administrators 2018-12-14 03:56:26 UTC Comment hidden (obsolete)
Comment 19 Frank Tobian 2019-02-13 14:54:51 UTC
Still present with libreoffice 6.1.4.2 on ubuntu 18.10

Diagramm and legend has different colors if you use the feature to set the colors with the HEXINDEZ at creation.
Comment 20 Frank Tobian 2019-02-14 09:47:29 UTC
Bug also confirmed with 6.2.0
Comment 21 JL 2019-02-22 10:48:39 UTC
This is maddening, and I will try to add another explanation why. It seems that what I would imagine are the more scarce use cases where pie charts are concerned are being prioritised over the most common one.

Here is a description of a real-world example. Periodically, I provide my boss with a breakdown of my time as a pie chart. The data are imported into LO from my time tracking app and plotted. There are many categories, and I only plot the top 10 for that time period. I want each category to maintain its colour from report to report, whether or not it is actually shown, so that easy visual comparison is possible. I do not want to have to cross-check and manually adjust the colours each time. 

Permanently setting the colours categories for the chart itself is easy, using the fill range - brilliant! However, this is rendered entirely pointless by the legend not matching.

I can see the difficulties expressed above, but wonder about the following as a compromise. Could a right-click option "Set legend to fill range" appear under "Data ranges..." in the specific case of pie charts where a fill colour range has been defined? Clicking this would cause the legend to be recreated based on the fill colour range, i.e. to match the chart at that point in time. If entries in the fill colour range then changed, the chart would become out of sync with the legend - fine if people really think that's expected behaviour - but the new option would at least give users the chance to set their legend correctly in a two click (or three click if an explanatory confirm dialog popped up) operation.
Comment 22 Cristian Seres 2019-07-11 22:23:10 UTC
Bug also confirmed with 6.2.5.2.
Comment 23 gregoire.paccoud 2020-03-30 15:00:47 UTC
Not reflecting the colors in the legend makes the function useless to me and got me to loose quite some time figuring out how this (doesn't) works.
Providing an option to get this behavior (legend reflecting colors) would be a solution. 
If not possible for another reason (I don't have the big picture in sight) please provide explanations so frustrations could be mitigated.
Comment 24 Will Braswell 2021-03-08 02:16:57 UTC
This is a CRITICAL BUG in the "Data Series" -> "Range for Fill Color" feature.

Version: 5.1.6.2
Build ID: 1:5.1.6~rc2-0ubuntu1~xenial10

As mentioned, the best approach is probably to have a simple checkbox for "Sync Legend Colors with Range for Fill Color" right next to each "Range for Fill Color" form field on each "Data Series".

When can we expect a fix for this bug?
Comment 25 trowelandmattock 2021-04-17 22:41:54 UTC
Confirmed in LO 7.1.2 (x64) WIN7

chart legend 'should' automatically reflect colors of data points - manual editing of the legend after creating tables with hex color-code schemes for data-series is a drastic back-step :/

The legend and data-series 'should' have 1:1 relation, ideally so changing a color or pattern of either affects both.

Having to manually edit the legend puts a !Dead-End! in work-flows with lots of charts that rely on well-prepared data-tables with colors to reflect complex ranges of attributes.

Is there a key reason preventing this as an 'easy fix' for the future ?

[fingers crossed]
Love You Libre!
Comment 26 trowelandmattock 2022-10-24 00:28:41 UTC
BTW:

my solution was to create charts (Pies in this case) without legends, and then create an additional BarChart using the same colors and categories as the Pies, but with a single dummy (i.e. 1) value - after trimming down the axis, adjusting plot area ect, this actually creates a far more usable 'Legend' graphic :

-text and order of items can be better controlled
-the 'Legend Chart' can picked, placed and treated as an individual graphic object when preparing documents for publication  ....

This suggests another solution to this issue and/or a more general function(probably only via a macro) ... ie a 'new' chart type: 

"LegendChart" = some kind of hard-coded BarChart that grabs its Color and Categories from the ranges of an already existing 'target' chart....
Comment 27 amathieux595 2023-06-18 18:14:15 UTC
Hi,this is till an issue in 7.5.4.2, I changed the bar colors of a Column chart, but the legend doesn't reflect this change,  it still uses the default colors.

Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 16; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
7.5.4-2
Calc: threaded
Comment 28 amathieux595 2023-06-18 18:21:12 UTC
Created attachment 187976 [details]
The chart with wrong legend colors
Comment 29 amathieux595 2023-06-18 18:22:47 UTC
(In reply to amathieux595 from comment #28)
> Created attachment 187976 [details]
> The chart with wrong legend colors

It is impossible to edit the legend's colors manually.
Comment 30 florian.berger 2024-09-23 17:50:24 UTC
I just got hit by this bug. With the legend colors deviating from the actual colors used in the chart, and no way to point the legend colors to the color code column, it becomes practically unusable.