Add Stack property to BarChartDataset and LineChartDataset#31
Add Stack property to BarChartDataset and LineChartDataset#31berndlueneburg wants to merge 2 commits into
Conversation
Added Stack property to BarChartDataset for dataset grouping.
Added Stack property to LineChartDataset for dataset grouping.
|
Thanks for the contribution and for taking the time to put this PR together. We already configure stacked behavior from chart options, so there is no need to expose the same configuration again on both BarChartDataset and LineChartDataset. Since both implementations represent the same behavior, we prefer to keep this configured in one place through options rather than duplicating it at the dataset level. For quick reference, this is already handled from BarChartOptions here: There is also already a demo showing this approach here: The sample below shows how stacked charts are configured today: barChartOptions.Scales.X.Stacked = true;
barChartOptions.Scales.Y.Stacked = true;Because of that, we are not planning to add Stack here. Thanks again for the PR and for the effort. |

Summary
Implements the
stackdataset property forBarChartDatasetandLineChartDataset— both files already carry a//stackplaceholder.stackis a standard Chart.js dataset option. On a stacked scale,datasets sharing the same
stackid are combined; datasets withdifferent ids render independently. This enables the documented
"Stacked Bar with Groups" chart, currently not expressible via the wrapper.
Changes
BarChartDataset: newstring? Stack(replaces the//Stackplaceholder)LineChartDataset: newstring? Stack(replaces the//stackplaceholder)Both follow the existing property pattern (
[AddedVersion],[DefaultValue(null)],[Description],[ParameterTypeName],[JsonIgnore(WhenWritingNull)]). Purely additive — no behaviour change,omitted from JSON when null.
[AddedVersion("1.2.3")]is a placeholder — happy to adjust to whateverthe next release version should be.