|   Contact  

Sample of new PieChart features

This sample shows:
  • New property Explosion on PieChart to create the effect of exploded Pie.
  • Support for shadows
  • New support for DataLabels in the Pie
  • New support for Legend for PieChart

This is how the chart looks like, just copy/paste the code into notepad and save it as .aspx:
Sample Pie


The code below does everything declaratively to make it simple and language agnostic. However all of the features shown here can be used programmatically as well.
The most important features shown below are the Explosion property, DataLabels and Legend.
You can set the properties pogrammatically as follows:
                PieChart chart = new PieChart();
                chart.Explosion = 15;
                chart.DataLabels.ShowXTitle = true;
                chartcontrol1.HasChartLegend = true;
<%@ Page language="c#" %>
<%@ Register tagPrefix="web" Assembly="WebChart" Namespace="WebChart" %>
<script runat=server>
 void Page_Load(object o, EventArgs e) {
            <title>Sample Pie</title>
            <form runat="server">
                  <web:chartcontrol id="chartcontrol1" runat="server" Background-Type="Hatch" Width="452px" Height="489px" GridLines="None" HasChartLegend="True" BorderStyle="Outset" TopPadding="20" ChartPadding="0">
                              <web:PieChart Legend="Some Legend" Explosion="15">
                                    <DataLabels Font="Tahoma, 8pt, style=Bold" ForeColor="White" Separator=": " Visible="True" ShowXTitle="True">
                                          <Background ForeColor="White" Color="DimGray" />
                                          <Border Color="Blue" />
                                          <web:ChartPoint XValue="Jan" YValue="6" />
                                          <web:ChartPoint XValue="Feb" YValue="20" />
                                          <web:ChartPoint XValue="Mar" YValue="12" />
                                          <web:ChartPoint XValue="Apr" YValue="16" />
                                          <web:ChartPoint XValue="May" YValue="10" />
                                          <web:ChartPoint XValue="Jun" YValue="8" />
                                          <web:ChartPoint XValue="Jul" YValue="23" />
                                          <web:ChartPoint XValue="Aug" YValue="20" />
                                          <web:ChartPoint XValue="Sep" YValue="2" />
                                          <web:ChartPoint XValue="Oct" YValue="16" />
                                    <Shadow OffsetY="5" Color="Gray" Visible="True" />
                        <ChartTitle ForeColor="White" Text="New PieChart!!!" Font="Tahoma, 12pt, style=Bold" />
                        <XAxisFont ForeColor="White" StringFormat="Center,Near,Character,LineLimit" />
                        <Legend Position="Bottom" Width="90" Font="Tahoma, 8.25pt, style=Bold">
                              <Background Type="Hatch" Color="Transparent" HatchStyle="Percent30" />
                        <Background Color="SteelBlue" HatchStyle="LargeGrid" />
                        <YTitle StringFormat="Center,Near,Character,LineLimit" />
                        <PlotBackground Type="Hatch" ForeColor="White" Color="Transparent" HatchStyle="SmallCheckerBoard" />

Carlos Aguilar Mares © 2017