We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize background and foreground settings in chart?

Platform: WinForms |
Control: Chart


The chart background image can be set either at run-time or at design time.The chart area background image can be changed using the ChartAreaBackImage Property. We can also set any solid color as the backcolor of the chart control as well as ChartArea.

The font face of the text can be chosen from any one 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.


// Settting Image to the Chart

ofd.InitialDirectory = @"..\..\Images";

ofd.Filter = "BackGround files (*.jpg)|*.jpg|All files (*.*)|*.*";

if(DialogResult.OK == ofd.ShowDialog())


filename = ofd.FileName;

this.chartControl1.ChartAreaBackImage = new Bitmap(filename);


// Setting Chart Background Color

this.chartControl1.ChartInterior = Color.Red;

// Changing font for chart axis

ChartAxis axis = this.chartControl1.PrimaryXAxis;

axis.Font = new Font(Font_Name, 10f, (FontStyle)Enum.Parse(typeof(FontStyle), this.cmb_FontStyle.SelectedItem.ToString(), true));

axis = this.chartControl1.PrimaryYAxis;


' Settting Image to the Chart

Dim ofd As OpenFileDialog = New OpenFileDialog()

ofd.InitialDirectory = "..\..\Images"

ofd.Filter = "BackGround files (*.jpg)|*.jpg|All files (*.*)|*.*"

If DialogResult.OK = ofd.ShowDialog() Then

filename = ofd.FileName

Me.chartControl1.ChartAreaBackImage = New Bitmap(filename)

End If

'Setting BackGroundColor

Me.chartControl1.ChartInterior = Color.Red

' Changing Font for chart axis

Dim axis As ChartAxis = Me.chartControl1.PrimaryXAxis

axis.Font = New System.Drawing.Font(Font_Name, 10.0F, Me.chartControl1.PrimaryXAxis.Font.Style)

axis = Me.chartControl1.PrimaryYAxis

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile