ASP.NET图表控件问题,后台不透明

时间:2012-07-12 11:12:51

标签: c# asp.net charts web

如何使此图表的白色部分透明, enter image description here

3 个答案:

答案 0 :(得分:2)

这就是我得到的;

<asp:Chart>
   <BorderSkin BackColor="Transparent" PageColor="Transparent" />
</asp:Chart>

在你的情况下,这将是

<asp:Chart ID="Chart1" runat="server" style="z-index: 1; left: 100px; top: 50px; position: absolute; background-color: transparent " BackColor="Transparent" PageColor="Transparent" DataSourceID="SqlDataSource1" BackImageTransparentColor="Silver" BorderlineColor="Transparent" Width="410px">
   <BorderSkin BackColor="Transparent" PageColor="Transparent" />
</asp:Chart>

答案 1 :(得分:2)

尝试这个我希望它的工作:

  <asp:Chart ID="Chart1" runat="server">

        <Series>
            <asp:Series Name="Series1" ChartType="Pie" XValueMember="relatedcity" 
                YValueMembers="state_id">
            </asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1" BackColor="Transparent">
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>

使用图表区域使其成为透明背景。

答案 2 :(得分:1)

设置图表和图表区域BackColor =“透明”

<asp:Chart ID="Chart1" runat="server" BackColor="Transparent" >
    <Titles>
        <asp:Title Text="Bubble Chart"></asp:Title>
    </Titles>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1" BackColor="Transparent"></asp:ChartArea>
    </ChartAreas>
    <Legends>
        <asp:Legend LegendStyle="Table" Docking="Bottom" IsDockedInsideChartArea="false" Name="Legend1"></asp:Legend>
    </Legends>
</asp:Chart>