今天我在工作中利用Teechart生成 成绩分析图,源代码主要片段先发上来。不好意思。没时间整理,大家自己看。我是菜鸟(^ - ^)
WebChart wc=new WebChart();
wc.Visible=true;
Steema.TeeChart.Chart ch2=wc.Chart;
MemoryStream tmpChart2=new MemoryStream();
ch2.Header.Text="总分对比";
ch2.Header.Font.Bold=false;
ch2.Header.Font.Color=Color.Red;
ch2.Header.Font.Size=10;
//控制面板的背景色
ch2.Panel.Brush.Gradient.EndColor = System.Drawing.Color.FromArgb(0xFF,0xEE,0xF2);
ch2.Panel.Brush.Gradient.StartColor = System.Drawing.Color.FromArgb(0xFE,0xCB,0xD7);
ch2.Panel.Brush.Gradient.Visible = true;
ch2.Aspect.View3D = false;
//外观
ch2.Aspect.Elevation = 315;
ch2.Aspect.Orthogonal = false;
ch2.Aspect.Perspective = 0;
ch2.Aspect.Rotation = 360;
ch2.Invalidate();
//设置线条
Line AnalyLine2=new Line();
AnalyLine2.OutLine.Color = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(0)));
AnalyLine2.ColorEachLine=false;
AnalyLine2.OutLine.Visible = true;
AnalyLine2.Pointer.Visible = true;
AnalyLine2.ColorEach=false;
AnalyLine2.Brush.Color = System.Drawing.Color.Green;
for(int x=0;x<4;x++)
{
AnalyLine2.Add(x,"第"+Convert.ToString(x+1)+"次");
}
ch2.Series.Add(AnalyLine2);
ch2.Width=300;
ch2.Height=160;
ch2.Export.Image.PNG.Save(Server.MapPath(ComFunction.StatImgPath+"ScoreAnalyse"+j.ToString()+".png"));
tr=new TableRow();
TableCell tc=new TableCell();
tc.HorizontalAlign=HorizontalAlign.Center;
tc.Text="<img src="""+ComFunction.StatImgPath+"ScoreAnalyse"+j.ToString()+".png"" border=0 width=300 height=160>";
tr.Cells.Add(tc);
tbStatImg.Rows.Add(tr);
转载于:https://www.cnblogs.com/heartcool/archive/2008/08/14/1267956.html