Problem in loading chart on the view in asp.net mvc?
Posted
by mary
on Stack Overflow
See other posts from Stack Overflow
or by mary
Published on 2010-03-13T05:59:00Z
Indexed on
2010/03/13
6:05 UTC
Read the original article
Hit count: 344
asp.net-mvc
hello, I am working on the chart project in asp.net mvc. i used followinf code to genrate the chart on the controller.
Chart chart1 = new Chart();
chart1.Height = 296;
chart1.Width = 412;
chart1.ImageType = ChartImageType.Png;
Title title = chart1.Titles.Add("Main");
Series series1 = chart1.Series.Add("series1");
chart1.Series["series1"].Points.DataBindXY(xvalues, yvalues);
chart1.Series["series1"].ChartType = SeriesChartType.Column ;
ChartArea chartArea = chart1.ChartAreas.Add("Default");
chartArea.Area3DStyle.Enable3D = false ;
MemoryStream ms = new MemoryStream();
chart1.SaveImage(ms);
return File(ms.GetBuffer(), @"image/png");
and on the view page i am calling it as
img src="/Home/SampleChart" alt="Sample Chart"
when i am running it on local pc its working fine but when i deployed it on server then chart is not displaying instated alernate text is showing. and its not working on another pc also. plz if anyone can know the reson tell me. thank you.
© Stack Overflow or respective owner