我使用 System.Web.UI.DataVisualization.Charting 创建了一个图表。图表显示在 google chrome 和 safari 上。但这在 windows xp IE8 上不可见。我真的不知道如何解决这个问题。
这是我创建图表的代码片段。
<img src="/ConvertFiles/CreateActualsVsForecastChart/?actuals=@(thisMonth)&forecast=@(prevMonth)" />
public FileResult CreateActualsVsForecastChart(string actuals, string forecast, string chartName)
{
//IList<ResultModel> peoples = _resultService.GetResults();
if (actuals.Equals(""))
actuals = "0";
if (forecast.Equals(""))
forecast = "0";
Chart chart = new Chart();
chart.Width = 350;
chart.Height = 400;
chart.BackColor = Color.FromArgb(211, 223, 240);
chart.BorderlineDashStyle = ChartDashStyle.Solid;
chart.BackGradientStyle = GradientStyle.TopBottom;
chart.BorderlineWidth = 1;
chart.Palette = ChartColorPalette.BrightPastel;
chart.BorderlineColor = Color.FromArgb(26, 59, 105);
chart.RenderType = RenderType.BinaryStreaming;
chart.BorderSkin.SkinStyle = BorderSkinStyle.Emboss;
chart.AntiAliasing = AntiAliasingStyles.All;
chart.TextAntiAliasingQuality = TextAntiAliasingQuality.Normal;
chart.Titles.Add(CreateTitle(chartName));
chart.Legends.Add(CreateLegend());
chart.Series.Add(CreateSeries4(new List<ChartKeyValue>()
{
new ChartKeyValue(){ Lable = "Forecast", Value = Convert.ToDouble(forecast), IsCurrent=true},
}, SeriesChartType.Column, "Forecast", "pink"));
chart.Series.Add(CreateSeries4(new List<ChartKeyValue>()
{
new ChartKeyValue(){ Lable = "Actual", Value = Convert.ToDouble(actuals), IsCurrent=true}
}, SeriesChartType.Column, "Actual", "blue"));
chart.ChartAreas.Add(CreateChartArea());
MemoryStream ms = new MemoryStream();
chart.SaveImage(ms);
return File(ms.GetBuffer(), @"image/png");
}
关于是什么导致它无法在 IE8 上显示的任何想法?谢谢。