HTML
后台代码:(dt为数据源)数据库中数据Sample
1 Chart1.Series["Series1"].Label = "#PERCENT{P}";//百分比形式2 Chart1.Series["Series1"].Points.DataBind(dt.DefaultView, "Result", "Score", "LegendText=Result,YValues=Score,ToolTip=Score");3 Chart1.Series["Series1"].ChartType = SeriesChartType.Pie;4 Chart1.Series["Series1"].ToolTip = "#LEGENDTEXT:#VAL{C} MILLION";5 6 Chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;7 Chart1.DataBind();
Chart Image的保存,下载:
string path = @"C:\Chart\Chart_" + DateTime.Now.ToString("yyyyMMddhhmm") + @"\";
if (!System.IO.Directory.Exists(path))
{
System.IO.Directory.CreateDirectory(path);
}
Chart1.SaveImage(path + "QC_Status.jpg", System.Web.UI.DataVisualization.Charting.ChartImageFormat.Jpeg);
时间: 2024-10-18 13:17:59