Click here to Skip to main content
15,608,772 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
friends i need to create pie chart in using Database ,please help me

1 solution

       <asp:Chart ID="Chart1" runat="server" Width="500px">
               <asp:Series Name="Education" XValueMember="name" YValueMembers="currency"
                   IsVisibleInLegend="true" ChartType="Pie">
               <asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="true">
                   <AxisX LineColor="DarkGray">
                       <MajorGrid LineColor="LightGray" />
                   <AxisY LineColor="DarkGray">
                       <MajorGrid LineColor="LightGray" />
                     <Area3DStyle Enable3D="True"></Area3DStyle>


private void CreateChart()
SqlConnection sqlconn = new SqlConnection(connection);
SqlCommand cmd = new SqlCommand();

cmd.Parameters.AddWithValue("@Queryno", "3");
cmd.CommandText = "Satish_Pro";
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Connection = sqlconn;
SqlDataAdapter adp = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();

if (ds.Tables[0].Rows.Count > 0)

Chart1.DataSource = ds;

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900