如何在Asp.net图表中隐藏白色边框

时间:2012-05-12 23:13:11

标签: asp.net charts

如何使用ASP.NET图表控件隐藏图表周围出现的白色边框?

<asp:Chart ID="chtGender" runat="server" BorderSkin-BorderColor="Green" Width="300" Height="350">
 <Series>
 <asp:Series ChartType="Pie"  Palette="EarthTones" ChartArea="MainChartArea">
 </asp:Series>
 </Series>
  <ChartAreas>
   <asp:ChartArea Name="MainChartArea"  BackColor ="Black" BorderColor = "Black"  BorderWidth= "0"  Area3DStyle-Enable3D="true">
   </asp:ChartArea>
  </ChartAreas>
</asp:Chart>

1 个答案:

答案 0 :(得分:1)

我有同样的问题,无法找到合适的解决方案。 我这样做的方法是将“chartarea”上的borderwidth设置为20,覆盖了饼图周围的白色边框。例如: -

<asp:Chart id="myPieChart" runat="server">
    <series>
        <asp:Series Name="Series1" ChartType="Pie">
            <Points>
                <asp:DataPoint YValues="45" />
                <asp:DataPoint YValues="34" />
                <asp:DataPoint YValues="67" />
            </Points>
        </asp:Series>
    </series>
    <chartareas>
        <asp:ChartArea Name="ChartArea1" 
             BackColor="#E6F1FA" 
             BorderDashStyle="Solid" 
             BorderWidth="20" 
             BorderColor="#E6F1FA">
        </asp:ChartArea>
    </chartareas>
</asp:Chart>