docs/cartesianChart/stackedcolumnseries.md
{{ render "~/shared/series.md" }}
{{ render "~/shared/datalabels.md" }}
If the stroke property is not set, then LiveCharts will create it based on the series position in your series collection and the current theme.
Series = new ISeries[]
{
new StackedColumnSeries<int>
{
Values = new List<int> { 3, 5, 3, 2, 5, 4, 2 },
Stroke = new SolidColorPaint(SKColors.Red) { StrokeThickness = 4 }, // mark
Fill = null,
},
new StackedColumnSeries<int>
{
Values = new List<int> { 4, 2, 3, 2, 3, 4, 2 },
Stroke = new SolidColorPaint(SKColors.Blue) { StrokeThickness = 8 }, // mark
Fill = null,
},
new StackedColumnSeries<int>
{
Values = new List<int> { 4, 6, 6, 5, 4, 3 , 2 },
Stroke = new SolidColorPaint(SKColors.Green) { StrokeThickness = 12 }, // mark
Fill = null,
}
};
:::info
Paints can create gradients, dashed lines and more, if you need help using the Paint instances take
a look at the [Paints article]({{ website_url }}/docs/{{ platform }}/{{ version }}/Overview.Paints).
:::
If the fill property is not set, then LiveCharts will create it based on the series position in your series collection and the current theme.
Series = new ISeries[]
{
new StackedColumnSeries<int>
{
Values = new List<int> { 3, 5, 3, 2, 5, 4, 2 },
Fill = new SolidColorPaint(SKColors.Red), // mark
Stroke = null,
},
new StackedColumnSeries<int>
{
Values = new List<int> { 4, 2, 3, 2, 3, 4, 2 },
Fill = new SolidColorPaint(SKColors.Blue), // mark
Stroke = null,
},
new StackedColumnSeries<int>
{
Values = new List<int> { 4, 6, 6, 5, 4, 3 , 2 },
Fill = new SolidColorPaint(SKColors.Green), // mark
Stroke = null,
}
};
:::info
Paints can create gradients, dashed lines and more, if you need help using the Paint instances take
a look at the [Paints article]({{ website_url }}/docs/{{ platform }}/{{ version }}/Overview.Paints).
:::
These properties define the corners radius in the rectangle geometry.
Series = new ISeries[]
{
new StackedColumnSeries<int>
{
Values = new List<int> { 3, 5, 3, 2, 5, 4, 2 },
Rx = 50, // mark
Ry = 50 // mark
},
new StackedColumnSeries<int>
{
Values = new List<int> { 4, 2, 3, 2, 3, 4, 2 },
Rx = 50, // mark
Ry = 50 // mark
},
new StackedColumnSeries<int>
{
Values = new List<int> { 4, 6, 6, 5, 4, 3 , 2 },
Rx = 50, // mark
Ry = 50 // mark
}
};
:::info
this section uses the ColumnSeries class, but it works the same for the StackedColumnSeries.
:::
Specifies the maximum width a column can take, take a look at the following sample, where the max width is 10.
Series = new ISeries[]
{
new ColumnSeries<int>
{
Values = new [] { 4, 4, 7, 2, 8 },
MaxBarWidth = 10 // mark
}
};
But now lets use double.MaxValue to see the difference.
Series = new ISeries[]
{
new ColumnSeries<int>
{
Values = new [] { 4, 4, 7, 2, 8 },
MaxBarWidth = double.MaxValue // mark
}
};
Finally we could also set the padding to 0.
Series = new ISeries[]
{
new ColumnSeries<int>
{
Values = new [] { 4, 4, 7, 2, 8 },
MaxBarWidth = double.MaxValue,
Padding = 0 // mark
}
};
Gets or sets the padding for each bar in the series.
Series = new ISeries[]
{
new StackedColumnSeries<int>
{
Values = new [] { 4, 4, 7, 2, 8 },
Padding = 5 // mark
},
new StackedColumnSeries<int>
{
Values = new [] { 2, 3,1, 4, 6 },
Padding = 5 // mark
}
};
{{ render "~/shared/series2.md" }}