Articles in this section
Category / Section

How to customize background and foreground settings in WinForms Chart?

4 mins read

The chart background image can be set either at runtime or at design time. The ChartInterior can set any solid color as the background color of the chart control as well as the chart area in WinForms Charts.

The font face of the text can be chosen from any of the system-supported font faces using the Font property of the ChartStyleInfo class. The font style of the series text can be changed by selecting any one of the different font styles using the FontStyle property of the ChartFontInfo class.


C#

// Set Chart Background Color
this.chartControl1.ChartInterior = new BrushInfo(Color.LightGreen);

// Change the font for chart axis
this.chartControl1.PrimaryXAxis.Font = new Font("Verdana", 10f, FontStyle.Bold);
this.chartControl1.PrimaryYAxis.Font = new Font("Verdana", 10f, FontStyle.Bold);

VB

'Set Chart Background Color
columnChart.ChartInterior = New BrushInfo(Color.LightGreen)

'Change font for chart axis
columnChart.PrimaryXAxis.Font = New Font("Verdana", 10.0F, FontStyle.Bold)
columnChart.PrimaryYAxis.Font = New Font("Verdana", 10.0F, FontStyle.Bold)
Output:

customize background and foreground settings


Conclusion

I hope you enjoyed learning about how to customize background and foreground settings in Winforms Chart.

You can refer to our WinForms Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our WinForms Chart examples to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you! 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied