Skip to content

Draw data labels on charts against axes, and draw funnel charts - #72

Merged
davidnmbond merged 1 commit into
mainfrom
feature/data-labels-and-funnel
Sep 28, 2026
Merged

davidnmbond merged 1 commit into
mainfrom
feature/data-labels-and-funnel

Conversation

@davidnmbond

Copy link
Copy Markdown
Contributor

Found rendering Magic Suite's [List.Graph:] macro examples through the Linux DocMagic (Magic Suite ticket MS-25916). Both of these rendered nothing and reported success.

Data labels

Label text was drawn only for pies, so labelText=#VAL on a column, bar or line chart produced a chart with no labels. SeriesRenderer now labels every point of a series that has label text, placed as measured against DocMagic:

  • centred just above a column, or above a line point, clear of its marker
  • just beyond the end of a bar, reading outwards
  • centred inside a stacked segment
  • beyond the far end on the other side for a negative value

Labels are drawn in their own dataLabels group after every series, so no series covers another's labels.

Funnels

Funnel was a SeriesChartType with nothing to draw it, so a funnel came out as an empty plot with a value axis. FunnelRenderer draws the Microsoft chart control's default YIsHeight funnel: segments stacked in order with heights in proportion to their values, narrowing to a neck, each in its point colour, with labels in a right-hand column joined by leader lines. Like a pie it has no axes and its legend describes points.

Label keywords

The substitution moved out of PieSlice into DataLabelText, shared by all three. It gains #VAL, which was never substituted even for pies because it is a prefix of #VALX and #VALY, and #SERIESNAME / #SER.

Tests

DataLabelAndFunnelTests adds 13. With the renderer before this change, 12 fail; the 13th is the negative case (no label text, no labels). The full suite passes: 105 of 105. Build: 0 errors, 0 warnings.

🤖 Generated with Claude Code

Both rendered nothing and reported success, found rendering Magic Suite's
[List.Graph:] examples (MS-25916):

- Label text was only drawn for pies, so labelText=#VAL on a column, bar or
  line chart gave a chart with no labels. SeriesRenderer now labels every
  point of a series that has label text: centred above a column or line
  point, beyond the end of a bar, inside a stacked segment. Placement was
  measured against DocMagic.
- Funnel was a SeriesChartType with nothing to draw it, so a funnel came
  out as an empty plot with a value axis. FunnelRenderer draws the
  Microsoft chart control's default YIsHeight funnel, with a neck, point
  colours, and labels in a column on the right joined by leader lines.
- The label keyword substitution moved out of PieSlice into DataLabelText,
  shared by all three, and gained #VAL (never substituted, even for pies,
  because it is a prefix of #VALX and #VALY) and #SERIESNAME/#SER.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 55 complexity · 0 duplication

Metric Results
Complexity 55
Duplication 0

View in Codacy

🟢 Coverage 95.38% diff coverage · +2.12% coverage variation

Metric Results
Coverage variation ✅ +2.12% coverage variation
Diff coverage ✅ 95.38% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (44ad0cc) 3327 2009 60.38%
Head commit (492f462) 3504 (+177) 2190 (+181) 62.50% (+2.12%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#72) 195 186 95.38%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@davidnmbond
davidnmbond merged commit 52053f1 into main Sep 28, 2026
8 checks passed
@davidnmbond
davidnmbond deleted the feature/data-labels-and-funnel branch September 28, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant