reports: a doughnut labels shares and names its slices - #7090
Merged
Conversation
A `chart: doughnut` report drew one unlabelled ring whose only text was the measure sum with a percent sign - a 336-hour billable split read "336% billable" - and nothing said which segment was which. Two causes. The page turned the legend off unless there were several measure series (`legend: series.length > 1`), but a circular chart slices ONE measure by the dimension: its slices are the dimension values, and the legend is the only thing that names them. And the chart library prints a pie/doughnut slice's raw value with a percent sign appended instead of its share (codbex/harmonia#113). So: the legend is always on for a circular chart and each entry carries the slice's share of the measure total, computed only when the fetched rows are the whole result - a windowed dashboard tile must not present a page-local share as the report's, the rule the table footer already applies to its totals. Pie and doughnut also pass `dataLabels: false`, dropping the value-as-percentage label until the pinned Harmonia carries the fix; polar area, whose labels are values by design, keeps them. A boolean dimension now reads Yes/No in the chart rather than the raw true/false, from two new shell keys. The same treatment goes to the entity report chart page (REPORT_PIE / REPORT_DOUGHNUT / REPORT_POLARAREA), which had the second half of the problem. Verified by IntentEngineIT: OrdersByCustomer gains `chart: doughnut` and the report-file stack test asserts the generated page's legend, share labels and suppressed data label. 67 tests, all green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7076
BillableSplit(dimensions: [billable],measures: ["sum(hours)"],chart: doughnut) rendered one blue ring labelled 336% - the hours sum with a percent sign - and no legend saying which segment was billable.Causes
legend: series.length > 1. That is right for a bar or line chart, where the legend names the series; it is wrong for a circular chart, which slices ONE measure by the dimension - there the legend is the only thing that names the slices, so a single-measure doughnut lost its only key.renderPiedraws the slice's raw value with a percent sign instead of the share it already computes. Fixed upstream in Chart: a pie/doughnut slice label is a share of the total, not the raw value codbex/harmonia#113; the pinned 2.14.2 still has it.Change
pie,doughnut,polarArea) always keeps its legend, and each legend entry carries the slice's share of the measure total -Billable - 84%,Non-billable - 16%.dataLabels: false, so the value-as-percentage label is gone until the pinned Harmonia carries the upstream fix. Polar area labels values by design and keeps them.true/false, from two newshell.report.*keys (en-US + bg-BG).REPORT_PIE/REPORT_DOUGHNUT/REPORT_POLARAREA) gets the same treatment - it had the second half of the problem.Verification
OrdersByCustomerinIntentEngineIT's intent gainschart: doughnut, and the report-file stack test asserts the generated page's chart type, legend, share labels and suppressed data label.