Thursday 29 August 2013

HOW TO USE ASP.NET AJAX PIE CHART

HOW TO USE ASP.NET AJAX PIE CHART 


1) Create Website
2) Add aspx page
3) Add toolkitScriptManager
4) If you don't have ajax control toolkit  download from codeplex
5) Add PieChart

asp:PieChart   Properties
1) Chart Title 
2) in PieChartValues  set Category to year  and Data to value.
3) set PieChartValueColor  in order to distinguish from each  category(year_) value.



Here 2 Pie charts  one for INDIA Industrail growth  2, China Industrail growth,



  <asp:PieChart runat="server" ChartTitle="INDIA Industrail growth" Width="300px" >
    <PieChartValues>
     <asp:PieChartValue PieChartValueColor="Blue" Category="2007" Data="20" PieChartValueStrokeColor="maroon" />
     <asp:PieChartValue PieChartValueColor="DarkRed" Category="2008" Data="20" PieChartValueStrokeColor="maroon" />
     <asp:PieChartValue PieChartValueColor="Teal" Category="2009" Data="20" PieChartValueStrokeColor="maroon" />
     <asp:PieChartValue PieChartValueColor="Gold" Category="2010" Data="40" PieChartValueStrokeColor="maroon" />
    </PieChartValues>

    </asp:PieChart>


    <asp:PieChart ID="PieChart1" runat="server" ChartTitle="CHINA Industrail growth" Width="300px" >
    <PieChartValues>
     <asp:PieChartValue PieChartValueColor="Blue" Category="2007" Data="10" PieChartValueStrokeColor="maroon" />
     <asp:PieChartValue PieChartValueColor="DarkRed" Category="2008" Data="30" PieChartValueStrokeColor="maroon" />
     <asp:PieChartValue PieChartValueColor="Teal" Category="2009" Data="30" PieChartValueStrokeColor="maroon" />
     <asp:PieChartValue PieChartValueColor="Gold" Category="2010" Data="30" PieChartValueStrokeColor="maroon" />
    </PieChartValues>
    </asp:PieChart>


5) Run the Page

No comments:

Post a Comment