Skip to content

Fix stack calculation for positive and negative values - #2085

Merged
beto-rodriguez merged 3 commits into
Live-Charts:devfrom
gang929:fix-StackedAreaSeries-Negative
Feb 8, 2026
Merged

Fix stack calculation for positive and negative values#2085
beto-rodriguez merged 3 commits into
Live-Charts:devfrom
gang929:fix-StackedAreaSeries-Negative

Conversation

@gang929

@gang929 gang929 commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Fix: The Negative+Positive values are not calculated correctly for the stacked graphics
issue 2073

beto-rodriguez and others added 3 commits September 11, 2025 20:23
@beto-rodriguez
beto-rodriguez changed the base branch from master to dev February 7, 2026 14:48
@gang929

gang929 commented Feb 8, 2026

Copy link
Copy Markdown
Contributor Author

The Unit Test show bellow. Has some config error in github action config?

Error: C:\Program Files\dotnet\sdk\9.0.310\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(38,5): error NETSDK1202: The workload 'net8.0-ios' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy. [D:\a\LiveCharts2\LiveCharts2\src\skiasharp\LiveChartsCore.SkiaSharp\LiveChartsCore.SkiaSharpView.csproj::TargetFramework=net8.0-ios]

@beto-rodriguez

Copy link
Copy Markdown
Collaborator

@gang929 Thanks for the fix, I think the issue is because this PR is using master as the base, I moved it to #2086, tests are running there.

@beto-rodriguez
beto-rodriguez merged commit 3e1498d into Live-Charts:dev Feb 8, 2026
2 of 4 checks passed
pull Bot pushed a commit to zilo555/LiveCharts2 that referenced this pull request Apr 26, 2026
… signs

PR Live-Charts#2085 fixed stacked area with mixed signs (Live-Charts#2073) by accumulating every
value into both End and NegativeEnd. That gave area charts an Excel-like
continuous baseline but broke stacked column/row series (Live-Charts#2152): a positive
bar above a previous negative value started at the negative end instead of 0.

Column/row stacks need positives and negatives in separate streams (each grows
from 0 in its own direction). Area/line stacks need a single running total to
keep the baseline continuous when values cross zero. Stacker now exposes both:
End/NegativeEnd are sign-segregated again, and a new CumulativeStart/CumulativeEnd
track always accumulates regardless of sign. CoreLineSeries and
CoreStepLineSeries read the cumulative track when stacked.

Snapshot regressions added for Live-Charts#2073 and Live-Charts#2152. The previous
StackedColumnsTests_Basic baseline was captured under the buggy behavior and
has been regenerated. The CoreTests ShouldHandleMixedPositiveNegativeValues
tests for stacked area / step area, which had been written to assert PR Live-Charts#2085's
broken numbers, now assert the correct dual-track + cumulative semantics.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants