backport(2.0.x): fixes from master (#2164, #2170, #2172, #2173, #2177, #2179) - #2184
Conversation
fix: null-gap line rendering on inserts and resize (#2132)
fix(avalonia): chart blank in ScrollViewer/Tab when data arrives off-screen (#1986)
…el-handled fix(avalonia): only mark wheel event as handled when zoom is enabled (#1864)
…m-pan-flags fix(zoom): split ZoomAndPanMode into per-gesture flags + honor NoFit in manual Zoom
…-clamp fix(pie): clamp gauge value to chart MaxValue (#2131)
Thanks for your contribution!The build and test process is starting. This may take a while. Packing complete!You can download the NuGet packages for this build here (dev-366). Running tests 🧪Tests are running now, you can monitor their progress below or at the actions tab. Core ✅ | Snapshot ✅ | Windows ✅ | Linux ✅ | Mac ✅ | Browser ✅ | Android ✅ | iOS ✅ Test Results Summary (Passed) ✅ |
There was a problem hiding this comment.
Pull request overview
Backports six bug-fix PRs from master into release/v2.0.x, covering rendering correctness (line gaps, stacking, pie gauge clamp), interactive zoom/pan behavior, and an Avalonia off-screen rendering deadlock—plus associated regressions/tests and docs updates.
Changes:
- Fixes line-series null-gap rendering regressions by rewriting
VectorManagerand removing unsafe path-container cleanup in line/step/polar line series. - Corrects stacking semantics for mixed-sign data by introducing cumulative stacking for area/line while keeping sign-segregated tracks for bars/rows.
- Improves interaction & platform behavior: granular
ZoomAndPanModeflags +NoFithonoring, Avalonia viewport visibility wake-up, and wheel-event handling only when zoom is enabled; adds/updates tests, snapshots, and docs.
Reviewed changes
Copilot reviewed 28 out of 34 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/SnapshotTests/StackedRowSeriesTests.cs | Adds snapshot regression test for mixed-sign stacked row rendering (#2152). |
| tests/SnapshotTests/StackedAreaTests.cs | Adds snapshot regression test for mixed-sign stacked area baseline behavior (#2073). |
| tests/SnapshotTests/PieChartTests.cs | Adds snapshot regressions for gauge values exceeding MaxValue/range (#2131). |
| tests/SnapshotTests/LineSeriesTests.cs | Adds deterministic snapshot regression for null-gap interpolated inserts (#2132). |
| tests/SharedUITests/CartesianChartTests.cs | Updates Avalonia UI test to use new #1986 repro and wait for async data load. |
| tests/CoreTests/SeriesTests/StackedStepAreaSeriesTest.cs | Updates core assertions to match new 3-track stack semantics (positive/negative/cumulative). |
| tests/CoreTests/SeriesTests/StackedAreaSeriesTest.cs | Updates core assertions to match new 3-track stack semantics (positive/negative/cumulative). |
| tests/CoreTests/OtherTests/ChartInteractiveApiTests.cs | Adds tests for granular zoom/pan flags and NoFit honoring in manual Zoom(). |
| tests/SnapshotTests/Snapshots/StackedRowSeriesTests_Issue2152_MixedSigns.png | Adds baseline image for new stacked-row regression. |
| tests/SnapshotTests/Snapshots/StackedAreaTests_Issue2073_MixedSigns.png | Adds baseline image for new stacked-area regression. |
| tests/SnapshotTests/Snapshots/PieChartTests_GaugeValueExceedsMaxValue.png | Adds baseline image for new pie-gauge clamp regression. |
| tests/SnapshotTests/Snapshots/StackedColumnsTests_Basic.png | Updates stacked-columns baseline to reflect corrected behavior. |
| src/LiveChartsCore/Measure/VectorManager.cs | Rewrites consecutive segment management to avoid stale eviction/RemoveAt path shifting; adds TrimTail(). |
| src/LiveChartsCore/CoreLineSeries.cs | Removes unsafe Count==1 cleanup, seeds new visuals consistently, uses cumulative stacking, calls TrimTail(). |
| src/LiveChartsCore/CoreStepLineSeries.cs | Mirrors CoreLineSeries fixes (cleanup removal, cumulative stacking, TrimTail(), new-visual seeding). |
| src/LiveChartsCore/CorePolarLineSeries.cs | Mirrors line-series fixes for polar paths and stacked baseline (cumulative). |
| src/LiveChartsCore/Kernel/Stacker.cs | Adds cumulative stacking track and restores sign-segregated behavior for bars/rows. |
| src/LiveChartsCore/Kernel/StackedValue.cs | Adds CumulativeStart/CumulativeEnd to expose new stacking track. |
| src/LiveChartsCore/CorePieSeries.cs | Clamps gauge/pie stack end to effective total/range so sweep cannot exceed full angle (#2131). |
| src/LiveChartsCore/Measure/ZoomAndPanMode.cs | Splits zoom/pan into granular flags (PanX/ZoomX/PanY/ZoomY) while keeping composites. |
| src/LiveChartsCore/CartesianChartEngine.cs | Updates gesture logic to consult granular flags; ensures manual Zoom(...NoFit...) is honored. |
| src/LiveChartsCore/Motion/CoreMotionCanvas.cs | Adds internal NotifyPlatformVisible() to bump frame timestamp for off-screen → visible transitions (Avalonia fix). |
| src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenChart.cs | Hooks EffectiveViewportChanged and triggers visibility wake-up + update when entering viewport. |
| src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/SourceGenCartesianChart.avalonia.cs | Only handles wheel event when zoom is enabled (don’t swallow scroll when zoom disabled). |
| src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/SourceGenCartesianChart.eto.cs | Only handles mouse wheel when zoom is enabled (lets container scrolling work otherwise). |
| samples/AvaloniaSample/VisualTest/VirtualizationTest/View.axaml | Removes old virtualization repro view (superseded by Issue1986Repro). |
| samples/AvaloniaSample/VisualTest/Issue1986Repro/ViewModel.cs | Adds async-data-load repro viewmodel for Avalonia #1986 scenario. |
| samples/AvaloniaSample/VisualTest/Issue1986Repro/View.axaml | Adds richer TabControl+ScrollViewer repro UI with off-screen charts. |
| samples/AvaloniaSample/VisualTest/Issue1986Repro/View.axaml.cs | Wires DataContext and kicks off async load; exposes helpers for UI tests. |
| samples/AvaloniaSample/MainWindowViewModel.cs | Registers the Avalonia-only Issue1986 repro in the sample list. |
| docs/samples/lines/zoom/template.md | Documents granular zoom/pan flags and examples. |
| docs/cartesianChart/axes.md | Documents granular zoom/pan flags and examples. |
| /// <summary> | ||
| /// Disables data bounds fitting when zooming or panning, this flag must be used in conjunction with | ||
| /// <see cref="X"/>, <see cref="Y"/>, or <see cref="Both"/> to have an effect. | ||
| /// any of the pan/zoom flags (<see cref="PanX"/>, <see cref="ZoomX"/>, <see cref="PanY"/>, <see cref="ZoomY"/>, | ||
| /// <see cref="X"/>, <see cref="Y"/>, or <see cref="Both"/>) to have an effect. | ||
| /// </summary> | ||
| NoFit = 1 << 2, | ||
| NoFit = 1 << 4, | ||
|
|
||
| /// <summary> | ||
| /// Disables the "Zoom by section" feature, which allows zooming in on a specific section of the chart. | ||
| /// </summary> | ||
| NoZoomBySection = 1 << 3, | ||
| NoZoomBySection = 1 << 5, | ||
|
|
||
| /// <summary> | ||
| /// When this flag is present the panning will be triggered using the right click on desktop devices and the touch-and-hold gesture on touch devices. | ||
| /// The "Zoom by section" feature will be triggered to the left click on desktop devices and the touch-and-hold gesture on touch devices, | ||
| /// this flag must be used in conjunction with | ||
| /// <see cref="X"/>, <see cref="Y"/>, or <see cref="Both"/> to have an effect. | ||
| /// When this flag is present the panning will be triggered using the right click on desktop devices and a double tap on touch devices. | ||
| /// The "Zoom by section" feature will be triggered by the left click on desktop devices and a single tap on touch devices, | ||
| /// this flag must be used in conjunction with any of the pan/zoom flags | ||
| /// (<see cref="PanX"/>, <see cref="ZoomX"/>, <see cref="PanY"/>, <see cref="ZoomY"/>, | ||
| /// <see cref="X"/>, <see cref="Y"/>, or <see cref="Both"/>) to have an effect. | ||
| /// </summary> | ||
| InvertPanningPointerTrigger = 1 << 6, |
Summary
Backports six bug-fix PRs from
masterontorelease/v2.0.x. Each is a behavior fix with no breaking API change.ScrollViewer/TabItemwhen data arrives off-screenZoomAndPanModegranular flags (PanX/ZoomX/PanY/ZoomY) + manualZoom()honorsNoFitPieChart: clamp gauge value to chartMaxValuesovalue > MaxValuecan't sweep past 360°Skipped from the same window:
MinSeparatorsfloor) — adds a new property to the publicIPlaneinterface (no default impl), which is a binary break for third-partyIPlaneimplementers. Not appropriate for a 2.0.x patch line.Resolution notes
A few merges had to be resolved by hand because the source branches diverged from 2.0.x:
tests/SnapshotTests/StackedRowSeriesTests.csdoesn't exist on 2.0.x. Kept only theIssue2152_MixedSignsregression test (the one this PR added) plus its baseline PNG. Skipped the pre-existingBasic/StackGrouptests since their baselines aren't on 2.0.x.tests/CoreTests/OtherTests/ChartInteractiveApiTests.csdoesn't exist on 2.0.x; ported only the eight new tests added by this PR (granular flag isolation +NoFithonoring). Also dropped thellms-full.txtmodification (file doesn't exist on 2.0.x — added later by docs/AI infrastructure on master).Test plan
dotnet build src/LiveChartsCore/LiveChartsCore.csproj -f net8.0— cleandotnet build src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj -f net8.0— cleandotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/...— clean (net462 + net8.0-windows + net8.0-windows10.0.19041)dotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/...— clean (net6.0 + net8.0 + netstandard2.0)dotnet test --project tests/CoreTests/CoreTests.csproj --framework net8.0— 125/125 passeddotnet test --project tests/SnapshotTests/SnapshotTests.csproj— 83/83 passed (including newStackedAreaTests_Issue2073_MixedSigns,StackedRowSeriesTests_Issue2152_MixedSigns,PieChartTests_GaugeValueExceedsMaxValue,PieChartTests_GaugeValueExceedsRangeWithMinValue)🤖 Generated with Claude Code