MiscellaneousUser
MiscellaneousUser

Reputation: 3043

How do you hide the white border in a Asp.net Chart

How do I hide the white border that appears round the chart using the ASP.NET charting control?

<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>

Upvotes: 0

Views: 1613

Answers (1)

Gary
Gary

Reputation: 11

I had the same problem and couldnt find a proper solution. The way I did it was set the borderwidth on the "chartarea" to 20 which overwrote the white border around my pie chart. eg:-

<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>

Upvotes: 1

Related Questions