Data can be added to the Pie chart by defining a series. Once you add a series you can add the ChartXData and ChartYData. The following values can be added to the ChartXData or ChartYData: DateTimeValue, DoubleValue, and StringValue. In this example you will use string values for the ChartXData and double values for ChartYData.
To add data to the bar chart using the PieChartSeries Collection, complete the following:
<cc1:C1PieChartExtender ID="Panel1_C1PieChartExtender" runat="server"
TargetControlID="Panel1">
<SeriesTransition Duration="1000" Easing="EaseOutBounce">
</SeriesTransition>
<Footer Compass="South" Visible="False">
</Footer>
<Axis>
<Y Compass="West" Visible="False">
<Labels TextAlign="Center">
</Labels>
<GridMajor Visible="True">
</GridMajor>
</Y>
</Axis>
</cc1:C1PieChartExtender>
Member | Data Property | Label Property | Offset Property |
---|---|---|---|
0 |
46.78 |
MacBook Pro | 15 |
1 |
23.18 |
iMac | 0 |
2 |
20.25 |
MacBook | 0 |
3 | 5.41 | Mac Pro | |
4 | 3.44 | Mac Mini |
Adding Data to the Pie Chart in Source View:
To add data to the Pie chart, click the source tab and add the following code in your source file:
<cc1:C1PieChartExtender ID="Panel1_C1PieChartExtender" runat="server"
TargetControlID="Panel1">
<SeriesTransition Duration="1000" Easing="EaseOutBounce">
</SeriesTransition>
<SeriesList>
<cc1:PieChartSeries Data="46.78" Label="MacBook Pro" LegendEntry="True"
Offset="15">
</cc1:PieChartSeries>
<cc1:PieChartSeries Data="23.18" Label="iMac" LegendEntry="True">
</cc1:PieChartSeries>
<cc1:PieChartSeries Data="20.25" Label="MacBook" LegendEntry="True">
</cc1:PieChartSeries>
<cc1:PieChartSeries Data="5.41" Label="Mac Pro" LegendEntry="True">
</cc1:PieChartSeries>
<cc1:PieChartSeries Data="3.44" Label="Mac Mini" LegendEntry="True">
</cc1:PieChartSeries>
</SeriesList>
<Footer Compass="South" Visible="False">
</Footer>
<Axis>
<Y Compass="West" Visible="False">
<Labels TextAlign="Center">
</Labels>
<GridMajor Visible="True">
</GridMajor>
</Y>
</Axis>
</cc1:C1PieChartExtender>
This topic illustrates the following:
When you run your project the Pie chart will appear like the following: