简体   繁体   中英

MSCHART with a transparent background

Any whay to make the background transparent of the MSCHART? thank's

You need to set the Chart background colour AND the ChartArea colour.

Chart c = new Chart();

c.BackColor = Color.Transparent;

c.ChartAreas.Add(new ChartArea("ChartArea1"));
c.ChartAreas[0].BackColor = Color.Transparent;

maybe this help you

in your.aspx file where your chart code is, look for the asp:ChartArea tag. then add BackColor = "Transparent".

<asp:ChartArea Name="ChartArea1" BackColor="Transparent" 
            </asp:ChartArea>

Hope this help.

This worked perfectly for me, HolesChart is the name of my Chart

HolesChart.ChartAreas["ChartArea1"].BackColor = Color.Transparent;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM