The following steps show how to create a Shared Pie chart in the C1Composite chart at design time and through source code. This type of chart allows a user to display related data using more than one pie chart on the same canvas. These pie charts share the same legend. Multiple pie charts in this example illustrate the comparative usage of each major browser in the year 2010 and 2014. The data in the pie chart on the left measures browser usage in the year 2010. The pie chart on the right displays data describing browser usage in the year 2014.
To add a shared pie chart data to the C1CompositeChart, follow these steps:
Type | Label | Center |
SharedPie | A New SharedPie | 150, 150 |
Member | Label | Data |
0 | Chrome | 6.04 |
1 | Firefox | 31.64 |
2 | IE | 55.25 |
Member | Label | Data |
0 | Chrome | 43.67 |
1 | Firefox | 23.18 |
2 | IE | 20.25 |
Use the following code to add a shared pie series to the composite chart.
Source View |
Copy Code
|
---|---|
<wijmo:C1CompositeChart ID="C1CompositeChart1" runat="server"> <SeriesList> <wijmo:CompositeChartSeries Label="A new SharedPie" LegendEntry="True" Type="SharedPie"> <CandlestickSeries LegendEntry="True"> </CandlestickSeries> <SharedPieChartSeries> <wijmo:CompositeSharedPieSeries LegendEntry="True" Center="150,150" Label="2010"> <PieSeriesList> <wijmo:PieChartSeries Data="46.78" Label="Chrome" LegendEntry="True"> </wijmo:PieChartSeries> <wijmo:PieChartSeries Data="23.18" Label="Firefox" LegendEntry="True"> </wijmo:PieChartSeries> <wijmo:PieChartSeries Data="20.25" Label="IE" LegendEntry="True"> </wijmo:PieChartSeries> </PieSeriesList> </wijmo:CompositeSharedPieSeries> <wijmo:CompositeSharedPieSeries LegendEntry="True" Center="300,150" Label="2014"> <PieSeriesList> <wijmo:PieChartSeries Data="23.6" Label="Chrome" LegendEntry="True"> </wijmo:PieChartSeries> <wijmo:PieChartSeries Data="18.9" Label="Firefox" LegendEntry="True"> </wijmo:PieChartSeries> <wijmo:PieChartSeries Data="22.85" Label="IE" LegendEntry="True"> </wijmo:PieChartSeries> </PieSeriesList> </wijmo:CompositeSharedPieSeries> </SharedPieChartSeries> </wijmo:CompositeChartSeries> </SeriesList> </wijmo:C1CompositeChart> |
This Topic Illustrates the Following:
The following image shows a Shared PieChart added to a composite chart: