aspx page
<asp:Chart ID="Chart1" runat="server" BorderlineWidth="0" Height="250px"Width="750px">
<Series>
<asp:Series Name="Series1" ChartType="Spline">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
<BorderSkin BorderWidth="0" />
</asp:Chart>
cs page
public void chart1bind()
{
try
{
Chart1.Series.Add("series1");
da = new SqlDataAdapter("select TOP 4 SUM(NET_TOTAL) as nettotal,INVOICE_DATE FROM bill group by INVOICE_DATE order by
INVOICE_DATE DESC ", con);
dt = new DataTable();
da.Fill(dt);
Chart1.DataSource = dt;
Chart1.Series["series1"].XValueMember = "INVOICE_DATE";
Chart1.Series["series1"].YValueMembers = "nettotal";
Chart1.DataBind();
Chart1.Visible = true;
}
catch (Exception)
{
}
}
No comments:
Post a Comment