/How-to-customize-series-border-in-Chart

This example demonstrates how to customize series border for chart in Windows Forms.

Primary LanguageC#

How to customize series border in WinForms Chart

This example demonstrates how to customize series border for chart in Windows Forms.

You can customize the border color and border width for chart series. The default value of the border color is black and border width is 1. You can also customize the specific series points border based on the point index.

The following code snippet demonstrates how to apply the border style to overall chart series points.

// Set border for to chart series.
series.Style.Border.Width = 3;
series.Style.Border.Color = Color.Red;

Winforms Chart with border and fill

The following code snippet demonstrates how to apply the border style to specific points in chart series.

// Set border style to specific chart series.
series.Styles[1].Border.Width = 3;
series.Styles[1].Border.Color = Color.Red;

Chart with fill and specific border

You can avoid the borders in series cells by setting the border’s color as “transparent” in series’ style as demonstrated in the following code snippet.

// Set the border color to transparent to avoid the borders for series. 
series.Style.Border.Color = Color.Transparent;

Chart with fill and without border

KB article - How to customize series border in WinForms Chart