Dundas 纯后台声明及生成图片流形式输出

Chart chart = new Chart(); chart.ID = "test"; chart.Palette = ChartColorPalette.Dundas; chart.BackColor = Color.FromArgb(243, 223, 193); Series series = new Series(); series.Name = "Default"; series.MarkerBorderColor = Color.FromArgb(64, 64, 64); series.CustomAttributes = "DrawingStyle=LightToDark"; series.BorderWidth = 0; series.Color = Color.FromArgb(255, 164, 32); ChartArea area = new ChartArea(); area.Name = "Default"; area.AxisX.LabelStyle.Font = new Font("Trebuchet MS", 0.688f); area.AxisX.MajorGrid.LineColor = Color.FromArgb(202, 202, 202); area.AxisY.LabelStyle.Font = new Font("Trebuchet MS", 0.688f); area.AxisY.MajorGrid.LineColor = Color.FromArgb(202, 202, 202); chart.ChartAreas.Add(area); chart.Series.Add(series); chart.RenderType = RenderType.BinaryStreaming; chart.AJAXZoomEnabled = false; chart.Width = 700; chart.Height = 350; GetData(series, chart); MemoryStream stream = new MemoryStream(); chart.Save(stream, ChartImageFormat.Jpeg); HttpContext.Current.Response.ClearContent(); HttpContext.Current.Response.ContentType = "image/Jpeg"; HttpContext.Current.Response.BinaryWrite(stream.ToArray());

你可能感兴趣的:(Dundas 纯后台声明及生成图片流形式输出)