这个是定义ChartArea的方法
///
/// 定义ChartArea
///
/// ChartArea名称
/// 是否开启3D
///
public static ChartArea SetChartAreaStyle(string name, bool Area3DStyle)
{
ChartArea mycharArea = new ChartArea(name);
mycharArea.AxisX.LineColor = System.Drawing.Color.FromArgb(64, 64, 64, 64);
mycharArea.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", float.Parse("8.25"), FontStyle.Regular);
mycharArea.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(64, 64, 64, 64);
mycharArea.AxisY.LineColor = System.Drawing.Color.FromArgb(64, 64, 64, 64);
mycharArea.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", float.Parse("8.25"), FontStyle.Regular);
mycharArea.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(64, 64, 64, 64);
if (Area3DStyle)
{
mycharArea.Area3DStyle.Enable3D = true;
mycharArea.Area3DStyle.IsRightAngleAxes = false;//是否倾斜
mycharArea.Area3DStyle.IsClustered = false;
//Chart1.ChartAreas["ChartArea1"].Area3DStyle.WallWidth = 0; //控制3D显示那个墙宽度的
mycharArea.Area3DStyle.Inclination = 15;//X倾斜度
mycharArea.Area3DStyle.Rotation = 10;//Y倾斜度
mycharArea.Area3DStyle.Perspective = 10;
}
mycharArea.BackColor = System.Drawing.Color.FromArgb(64, 165, 191, 228);
// BackSecondaryColor="Transparent" BorderColor="64, 64, 64, 64"
mycharArea.BackSecondaryColor = System.Drawing.Color.Transparent;
mycharArea.BorderColor = System.Drawing.Color.FromArgb(64, 64, 64, 64);
mycharArea.AxisY.ScaleBreakStyle.Enabled = true;//开启对比悬殊的东东
//mycharArea.AxisX.Interval = 1;
//mycharArea.AxisY.Interval = 5000; //强制 Y轴最小单位为5000一格
//mycharArea.AxisX.MajorGrid.Interval = 1;
//mycharArea.Area3DStyle.Enable3D = true;
//mycharArea.AlignmentOrientation = AreaAlignmentOrientations.Horizontal;
//mycharArea.AxisY.Enabled = AxisEnabled.False;
//mycharArea.AxisY2.Enabled = AxisEnabled.True;
//mycharArea.AxisX.LabelStyle.IsEndLabelVisible = false;
return mycharArea;
}
其中比较有用的东东有
mycharArea.AxisY.ScaleBreakStyle.Enabled = true; //开启对比悬殊的东东 现在不让上传图 要不然可以看效果的
mycharArea.Area3DStyle.Enable3D = true; //开启3D显示
其它的一些属性 程序中注释里有