This is my code and is working fine
<asp:Chart ID="chartColumn" runat="server" BackColor="WhiteSmoke" BackSecondaryColor="White"BackGradientStyle="TopBottom" BorderDashStyle="Solid" Palette="BrightPastel"
BorderColor="26, 59, 105" Height="460px" Width="530px" BorderWidth="2" ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)">
<Legends><asp:Legend Name="Default" BackColor="Transparent" Font="Trebuchet MS, 8pt, style=Bold"
AutoFitMinFontSize="6" Docking="Top" LegendStyle="Table" ForeColor="Red"> </asp:Legend>
</Legends><BorderSkin SkinStyle="Emboss"></BorderSkin> <Series> </Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid" BackSecondaryColor="White" BackColor="Gainsboro" ShadowColor="Transparent" BackGradientStyle="TopBottom">
<Position Height="85" Width="90" X="4" Y="5" />
<AxisY LineColor="64, 64, 64, 64" IsLabelAutoFit="False"><LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</AxisY>
<AxisX LineColor="64, 64, 64, 64">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" IntervalType="Auto" /><MajorGrid Interval="Auto" IntervalType="Auto" LineColor="64, 64, 64, 64" />
<MajorTickMark IntervalType="Auto" />
</AxisX>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
Method code behind
public void FillChart(int DId)
{
chartColumn.Legends["Default"].Docking = Docking.Bottom;
chartColumn.Legends["Default"].Alignment = System.Drawing.StringAlignment.Center;
chartColumn.Legends["Default"].LegendStyle = LegendStyle.Table;
PID = Convert.ToInt32(ViewState["PatId"].ToString());
CmsIdentity objIdentity = (CmsIdentity)Context.User.Identity;
DataSet dsChart = new DataSet();
clsPatientEPRResultsDb objResultDb = new clsPatientEPRResultsDb();
dsChart = objResultDb.GetTestResultForChart(DId, PID, objIdentity.AccountInfoID, "");
if (dsChart.Tables[0].Rows.Count > 0)
{
chartColumn.Visible = true;
DataView dv = dsChart.Tables[0].DefaultView;
seriesname = "Result";
chartColumn.Series.Add(seriesname);
chartColumn.Series[seriesname].ChartArea = "ChartArea1";
chartColumn.Series[sername].ChartType = SeriesChartType.Column;
chartColumn.Series[sername].Palette = ChartColorPalette.BrightPastel;
chartColumn.Series[seriesname].Name = seriesname;
chartColumn.Series[seriesname].Color = System.Drawing.Color.Red;
chartColumn.Series[seriesname].IsValueShownAsLabel = true;
chartColumn.Series[seriesname].Points.DataBindXY(dv, "ResultDate1", dv, "Result");
string CharPic = Server.MapPath("TempPDF/") + "Result(" + DateTime.Now.ToString("ddMMMyyyyhhmmss") + ").jpeg";
chartColumn.SaveImage(CharPic, ChartImageFormat.Jpeg);
chartColumn.Series[seriesname].Points.DataBindXY(dv, "ResultDate1", dv, "Result");
}
}
Please see if this solves your problem, as i cannot see any problem in your code.