Microsoft chart control fidelity: gridlines, clipping, culture, Y axis title, label backgrounds, legend layout (fixes #77) - #78
Merged
Conversation
…rt control does (fixes #77) Found by the Magic Suite renderer comparison (MS-26667). Axes and plot: - MajorGridInterval spaces major gridlines independently of the labels. - Gridline dash styles, and a minor gridline width of its own. - AxisArea.IntervalStartsAtMinimum counts ticks from an explicit minimum. - AxisArea.IsMarginVisible lets the categories run from end to end. - Series are clipped to the inner plot. - The Y axis title is shrunk to fit beside the tick labels, or left out. - Chart.Culture formats axis and data labels (C2, P0, decimals). - Series.LabelBackColor fills behind data labels. Legends: - Table style, laid out in as many columns as the height needs. - LegendItemOrder, Auto listing stacked series from the top of the stack. - TextWrapThreshold, 25 characters by default. - A row wraps instead of running off the legend; a short column keeps entries a line apart; a label too wide for the image gives up the inset, then is shortened with an ellipsis. - Pie and funnel legends honour the style. Text is measured with the embedded face for all of this. Version 9.2: new public API, and the legend order, text wrapping and plot clipping defaults change existing output. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| BestPractice | 1 minor |
| Complexity | 2 medium |
🟢 Metrics 91 complexity · 2 duplication
Metric Results Complexity 91 Duplication 2
🟢 Coverage 88.97% diff coverage · +1.21% coverage variation
Metric Results Coverage variation ✅ +1.21% coverage variation Diff coverage ✅ 88.97% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (4fe8f47) 3553 2909 81.87% Head commit (7cb6e56) 3825 (+272) 3178 (+269) 83.08% (+1.21%) 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 (#78) 417 371 88.97% 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.
TIP This summary will be updated as you push new changes.
…o its width (#77) - The outer border is drawn after the legend and annotations, so the legend's box no longer covers it, and inset by half its width so none of it falls off the image. Any other stroked element is inset the same way. - Dash patterns are the GDI+ ones in units of the line width, as the Microsoft chart control draws them, and dashed strokes use butt caps: round caps closed the gaps, so a thick dashed line read as solid. Dot was drawn as a dash. - A legend label gives up its inset against the image edge as well as the legend's, so "Manchester" fits a 144 pixel legend unshortened. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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 #77. Found by the Magic Suite ChartMagic vs DocMagic comparison (Jira epic MS-26667); each item is a setting that drew differently from the Microsoft chart control, or could not be expressed so Magic Suite refused the whole chart.
See the commit message for the full list. In short:
IntervalStartsAtMinimum);IsMarginVisibleon the category axis.Chart.Culturefor axis and data labels.Series.LabelBackColor.LegendItemOrder(stacked series listed from the top),TextWrapThreshold(25 by default), row wrapping, short columns kept a line apart, labels kept on the image, and pie legends honouring the style.Version 9.2. New public API, and three defaults change existing output: stacked charts list their legend in reverse, legend text over 25 characters wraps, and series are clipped to the plot. Each matches the Microsoft chart control.
Tests: 136 pass (121 existing, of which three were updated: two marker tests now ignore the plot clip in
<defs>, and the overlap test allows a wrapped row; plus 15 new inRendererFidelityTestsand 8 new legend tests).Do not merge yet: being verified against the Magic Suite integration first.
🤖 Generated with Claude Code