Search code examples
vb.netwindowsmschart

How to change MS-Chart area color in windows application


I am using MS-Chart in a windows application. How can I change the white area in the center of the chartarea?


Solution

  • Updated answer to reflect comment: Actual code using details from previous answers: 1st, dim and create (New) chart object (.Net chart rather than Excel chart).

    2nd, Add a chart area and give it any name. The new ChartArea will have an index of 0.

    3rd, Using the BackColor property, set the color to red.

    dim MyChart as New System.Windows.Forms.DataVisualization.Charting.Chart
    MyChart.ChartAreas.Add("ChartArea")
    MyChart.ChartAreas(0).BackColor = Color.Red