Summary: | Add option to align legend entries with data on chart (improving chart readability) | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Arthur Fragoso <arthur> |
Component: | Chart | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | NEW --- | ||
Severity: | enhancement | CC: | heiko.tietze, stephane.guillou |
Priority: | medium | ||
Version: | Inherited From OOo | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.documentfoundation.org/show_bug.cgi?id=94235 https://bugs.documentfoundation.org/show_bug.cgi?id=66339 |
||
Whiteboard: | |||
Crash report or crash signature: | Regression By: | ||
Bug Depends on: | |||
Bug Blocks: | 108542, 108543 | ||
Attachments: |
Example
sample ODS with line charts (to test comment 1 workaround) screenshot of feature in Google Sheets |
Description
Arthur Fragoso
2022-07-18 06:25:14 UTC
I guess there's two requests here: - connecting legend with callouts, which is already possible by using data labels and the options "leader lines" - aligning the legend to the data series, which I focus on below. Its true that it's hard to adapt the Series data label implemented for bug 94235 to cover this common use case: 0. Don't add a classic legend 1. Add data label to whole chart 2. Change settings to "Series name" and "Legend key" 3. Change Placement to "right" 4. Click twice (slowly) on each duplicate data labels to select them individually and Delete. Step 4 is completely impractical for more than a handful of labels. With what we currently have, we should be able to add a setting that acts as a shortcut for the above, for example in the Wizard's "Chart elements": [X] Display legend ° Left ° Right ° Top ° Bottom ° Label the series ... but it would be a hack that would likely conflict with other data label settings. (i.e. what happens if one wants to use this new setting, but also label the data points with values? It would require two "layers" of labels.) UX/Design team, what do you think? Sounds very specific and rather suited for a macro (advanced graphics should be done with specialized apps like R). Can you share an example to make testing easier? Created attachment 190959 [details] Example (In reply to Stéphane Guillou (stragu) from comment #1) > 1. Add data label to whole chart It's not available in the context menu (which would be a good enhancement) but in the main menu under Insert) > 2. Change settings to "Series name" and "Legend key" > 3. Change Placement to "right" > 4. Click twice (slowly) on each duplicate data labels to select them > individually and Delete. Don't get this > - connecting legend with callouts, which is already possible by using data > labels and the options "leader lines" Missing the connector lines. And it would be rather with the Attribute Options > Placement in the Data Labels dialog. I wonder if the Data Label tip helps Arthur. Is this what you were looking for? What should we improve? Created attachment 190972 [details] sample ODS with line charts (to test comment 1 workaround) See my sample ODS for my suggested workaround. My steps applied to a line chart, you can start from the chart titled "original". As you can see, a tedious workaround, even with only 20 datapoints. (In reply to Heiko Tietze from comment #3) > (In reply to Stéphane Guillou (stragu) from comment #1) > > 4. Click twice (slowly) on each duplicate data labels to select them > > individually and Delete. > Don't get this This is because clicking once on a label will select the whole series of labels, and double-clicking opens the dialog. Click a second time on a label to select it individually, so you can remove it. > > - connecting legend with callouts, which is already possible by using data > > labels and the options "leader lines" > Missing the connector lines. And it would be rather with the Attribute > Options > Placement in the Data Labels dialog. They only appear once a certain distance from the series is reached. In your sample file, try moving an individual point away from the pie to make it appear. I think they should remain separate from the "Placement" setting, as one can define a default position for labels and then decide if yes or no leader lines are displayed when a labelled is moved away by hand. (In reply to Stéphane Guillou (stragu) from comment #4) > See my sample ODS for my suggested workaround. Now I understand, you abuse the last data label as legend. This will very likely fail for many reasons (last data points are very close, inappropriate y scaling like logarithmic hides the last data point, reverse x direction, RTL, other chart types). But as you said, it's a workaround. (In reply to Stéphane Guillou (stragu) from comment #4) > [X] Display legend We are talking about Legend > Properties > Position? > ° Left, Top, Right, Bottom > ° Label the series It might be very welcome by the users but I don't see how we label series in a callout style for every type of chart and all situations. And again: what do you think, Arthur? Is Insert > Data Labels sufficient for you? (In reply to Heiko Tietze from comment #5) > Now I understand, you abuse the last data label as legend. This will very > likely fail for many reasons (last data points are very close, inappropriate > y scaling like logarithmic hides the last data point, reverse x direction, > RTL, other chart types). But as you said, it's a workaround. Indeed! > We are talking about Legend > Properties > Position? Either in Wizard > Chart Elements > Display legend, or in Insert > Legend > Position > > ° Label the series > It might be very welcome by the users but I don't see how we label series in > a callout style for every type of chart and all situations. True. Actually, I think what would be doable and simplest: [X] Display legend ° Left ° Right ° Top ° Bottom [ ] Align with data The last option (only available if Display Legend is on) would: - for each series, take the x or y value of the data point closest to the legend (depending on position option) - use that value to position each corresponding legend entry - offset them if there are overlaps - update the position on each data or chart change This should suit most charts (but there will always be visualisations where such an option would not be useful, comes down to user choice). And potentially an extra option to add "[ ] Leader lines" to the chart area's edge. (Useful if position was offset for avoiding overlap.) (In reply to Stéphane Guillou (stragu) from comment #6) > And potentially an extra option to add "[ ] Leader lines" to the chart > area's edge. Sorry, should be "chart wall's edge". Since Arthur doesn't respond the final call is for you, Stephane. OK, I changed the summary accordingly. If someone wants to pick it up (and depending on what ODF can do, I presume), please see comment 6. In Google Sheets, the equivalent for a Pie chart is using Legend > Position > Labeled. For this chart, it splits the legend on left and right of the pie, aligns the entries with the data (but avoids overlap) and draws leader lines. As Arthur mentioned, this option is greyed out for other chart types. An export of such a chart to XLSX or ODS results in the default legend, at the right of the pie. (Same for a re-import into Google Sheets.) Created attachment 191363 [details]
screenshot of feature in Google Sheets
What it looks like for Pie charts in Google Sheets.
Even though this is only available for Pie charts in Google Sheets, this feature should be available for other chart types like Line charts or Area charts.
|