使用Dundas.Charting
以下为我使用时的以下方法:
protected void ChartStyle(Chart AChart)
{
AChart.Legend.
Alignment = System.Drawing.StringAlignment.Center;
AChart.Legend.
Docking = LegendDocking.Bottom;
AChart.Legend.
LegendStyle = LegendStyle.Row;
AChart.Compression = 20;
AChart.ImageType = ChartImageType.Jpeg;
AChart.BorderSkin.SkinStyle = BorderSkinStyle.Emboss;
AChart.BorderSkin.FrameBackColor = System.Drawing.Color.DarkKhaki;
AChart.BorderSkin.FrameBackGradientEndColor = System.Drawing.Color.PeachPuff;
AChart.BorderSkin.FrameBackGradientType = GradientType.DiagonalLeft;
AChart.BorderSkin.FrameBackHatchStyle = ChartHatchStyle.Trellis;
AChart.BackGradientEndColor = System.Drawing.Color.PeachPuff;
AChart.BackGradientType = GradientType.TopBottom;
AChart.BackHatchStyle = ChartHatchStyle.DashedUpwardDiagonal;
}
protected void SeriesMarkerStyle(string ChartType,Series series,System.Drawing.Color Color)
{
series.ChartType = ChartType;
series.Color = Color;
series.MarkerBorderColor = System.Drawing.Color.Black;
series.MarkerColor = System.Drawing.Color.SpringGreen;
series.MarkerSize = 5;
series.MarkerStep = 1;
series.MarkerStyle = MarkerStyle.Circle;
series.BorderWidth = 3;
series.ShadowOffset = 2;
}
protected void SeriesMarkerStyle1(string ChartType,Series series,System.Drawing.Color Color)
{
series.ChartType = ChartType;
series.Color = Color;
series.MarkerBorderColor = System.Drawing.Color.Black;
series.MarkerColor = System.Drawing.Color.SpringGreen;
series.MarkerSize = 15;
series.MarkerStep = 1;
series.MarkerStyle = MarkerStyle.Diamond;
series.BorderWidth = 3;
series.ShadowOffset = 2;
}
protected void PointZero(Series series,int pt)
{
series.Points[pt].BorderWidth = 3;
series.Points[pt].BorderStyle = ChartDashStyle.Dot;
series.Points[pt].BorderColor = System.Drawing.Color.Gainsboro;
series.Points[pt].Empty = true;
}
}