赞
踩
一些同学总是觉得winform控件不好看,这里给大家展示一些Chart控件好看的样式,希望能帮到你。
#region 雷达图
//chart2.BackColor = Color.Transparent;
//chart2.ChartAreas.Clear();
//chart2.Series.Clear();
//chart2.Legends.Clear();
//chart2.ChartAreas.Add("ChartAreas1");
//chart2.ChartAreas[0].AxisY.LabelStyle.ForeColor = Color.FromArgb(116, 121, 127);
//chart2.ChartAreas[0].AxisY.LineColor = Color.FromArgb(105, 111, 119);
//chart2.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.FromArgb(50, 46, 60);
//chart2.ChartAreas[0].AxisY.MajorTickMark.Size = 0F;
//chart2.ChartAreas[0].BackColor = Color.FromArgb(12, 27, 44);
//chart2.ChartAreas[0].Position = new ElementPosition(0,5,70,90);
//chart2.Legends.Add("Legends1");
//chart2.Legends[0].Alignment = StringAlignment.Center;
//chart2.Legends[0].Font = new Font("微软雅黑", 8F);
//chart2.Legends[0].ForeColor = Color.FromArgb(158, 160, 164);
//chart2.Legends[0].BackColor = Color.Transparent;
//chart2.Series.Add("Series1");
//chart2.Series[0].CustomProperties = "AreaDrawingStyle=Polygon";
//chart2.Series[0].BackGradientStyle = GradientStyle.DiagonalLeft;
//chart2.Series[0].BorderColor = chart2.Series[0].Color = Color.FromArgb(17, 91, 238);
//chart2.Series[0].ChartArea = "ChartAreas1";
//chart2.Series[0].ChartType = SeriesChartType.Radar;
//chart2.Series[0].MarkerBorderColor = Color.Transparent;
//chart2.Series[0].Points.Add(new DataPoint(0,80));
//chart2.Series[0].Points.Add(new DataPoint(1,70));
//chart2.Series[0].Points.Add(new DataPoint(2,60));
//chart2.Series[0].Points.Add(new DataPoint(3,30));
//chart2.Series[0].Points.Add(new DataPoint(4,20));
//chart2.Series[0].Points.Add(new DataPoint(5,10));
//chart2.Series.Add("Series2");
//chart2.Series[1].CustomProperties = "AreaDrawingStyle=Polygon";
//chart2.Series[1].BackGradientStyle = GradientStyle.DiagonalLeft;
//chart2.Series[1].BorderColor = chart2.Series[1].Color = Color.Lime ;
//chart2.Series[1].ChartArea = "ChartAreas1";
//chart2.Series[1].ChartType = SeriesChartType.Radar;
//chart2.Series[1].MarkerBorderColor = Color.Transparent;
//chart2.Series[1].Points.Add(new DataPoint(0, 50));
//chart2.Series[1].Points.Add(new DataPoint(1, 50));
//chart2.Series[1].Points.Add(new DataPoint(2, 50));
//chart2.Series[1].Points.Add(new DataPoint(3, 50));
//chart2.Series[1].Points.Add(new DataPoint(4, 50));
//chart2.Series[1].Points.Add(new DataPoint(5, 50));
//chart2.Series.Add("Series3");
//chart2.Series[2].CustomProperties = "AreaDrawingStyle=Polygon";
//chart2.Series[2].BackGradientStyle = GradientStyle.DiagonalLeft;
//chart2.Series[2].BorderColor = chart2.Series[2].Color = Color.FromArgb(255, 125, 0);
//chart2.Series[2].ChartArea = "ChartAreas1";
//chart2.Series[2].ChartType = SeriesChartType.Radar;
//chart2.Series[2].MarkerBorderColor = Color.Transparent;
//chart2.Series[2].Points.Add(new DataPoint(0, 10));
//chart2.Series[2].Points.Add(new DataPoint(1, 20));
//chart2.Series[2].Points.Add(new DataPoint(2, 30));
//chart2.Series[2].Points.Add(new DataPoint(3, 40));
//chart2.Series[2].Points.Add(new DataPoint(4, 50));
//chart2.Series[2].Points.Add(new DataPoint(5, 60));
#endregion
#region 波形图1 圆线
//chart1.BackColor = Color.FromArgb(0, 15, 31);
chart1.BackColor = Color.Transparent;
//chart1.ChartAreas.Clear();
//chart1.Series.Clear();
//chart1.Legends.Clear();
//chart1.ChartAreas.Add("ChartAreas1");
//chart1.ChartAreas[0].AxisX.LabelStyle.ForeColor = Color.FromArgb(213, 216, 218);
//chart1.ChartAreas[0].AxisX.LineColor = chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.FromArgb(64, 64, 64);
//chart1.ChartAreas[0].AxisX.LineDashStyle = chart1.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.Dot;
//chart1.ChartAreas[0].AxisX.Minimum = 0D;
//chart1.ChartAreas[0].AxisX.MajorTickMark.Enabled = false;
//chart1.ChartAreas[0].AxisX.IsMarginVisible = false;
chart1.ChartAreas[0].AxisX.Title = "加上这个Y轴的那根黑线就没有,你说奇怪部奇怪";
chart1.ChartAreas[0].AxisX.TitleAlignment = StringAlignment.Near;
chart1.ChartAreas[0].AxisX.TitleForeColor = Color.Chocolate;
//chart1.ChartAreas[0].AxisY.LabelStyle.ForeColor = Color.FromArgb(213, 216, 218);
//chart1.ChartAreas[0].AxisY.LineColor = chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.FromArgb(64, 64, 64);
//chart1.ChartAreas[0].AxisY.LineDashStyle = chart1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dot;
//chart1.ChartAreas[0].AxisY.Minimum = 0D;
//chart1.ChartAreas[0].AxisY.MajorTickMark.Enabled = false;
//chart1.ChartAreas[0].AxisY.LineWidth = 0;
//chart1.ChartAreas[0].BackColor = Color.Transparent;
//chart1.Legends.Add("Legends1");
//chart1.Legends[0].Docking = Docking.Top;
//chart1.Legends[0].Alignment = StringAlignment.Far;
//chart1.Legends[0].Font = new Font("微软雅黑", 8F);
//chart1.Legends[0].ForeColor = Color.FromArgb(213, 216, 218);
//chart1.Legends[0].BackColor = Color.Transparent;
//chart1.Legends[0].LegendStyle = LegendStyle.Row;
//chart1.Series.Add("Series1");
//chart1.Series[0].BackGradientStyle = GradientStyle.DiagonalRight;
//chart1.Series[0].BorderColor = chart2.Series[0].Color = Color.FromArgb(26, 124, 237);
//chart1.Series[0].BorderWidth = 2;
//chart1.Series[0].ChartArea = "ChartAreas1";
//chart1.Series[0].ChartType = SeriesChartType.SplineArea;
//chart1.Series[0].LabelForeColor = Color.Empty;
//chart1.Series[0].Points.Add(new DataPoint(0, 10));
//chart1.Series[0].Points.Add(new DataPoint(1, 20));
//chart1.Series[0].Points.Add(new DataPoint(2, 60));
//chart1.Series[0].Points.Add(new DataPoint(3, 30));
//chart1.Series[0].Points.Add(new DataPoint(4, 20));
//chart1.Series[0].Points.Add(new DataPoint(5, 10));
//chart1.Series.Add("Series2");
//chart1.Series[1].BackGradientStyle = GradientStyle.DiagonalRight;
//chart1.Series[1].BorderColor = chart1.Series[1].Color = Color.Cyan;
//chart1.Series[1].BorderWidth = 2;
//chart1.Series[1].ChartArea = "ChartAreas1";
//chart1.Series[1].ChartType = SeriesChartType.SplineArea;
//chart1.Series[1].LabelForeColor = Color.Empty;
//chart1.Series[1].Points.Add(new DataPoint(0, 80));
//chart1.Series[1].Points.Add(new DataPoint(1, 70));
//chart1.Series[1].Points.Add(new DataPoint(2, 60));
//chart1.Series[1].Points.Add(new DataPoint(3, 10));
//chart1.Series[1].Points.Add(new DataPoint(4, 20));
//chart1.Series[1].Points.Add(new DataPoint(5, 30));
#endregion
#region 波形图2 折线
chart1.BackColor = Color.FromArgb(0, 15, 31);
//chart1.BackColor = Color.Transparent;
chart1.ChartAreas.Clear();
chart1.Series.Clear();
chart1.Legends.Clear();
chart1.ChartAreas.Add("ChartAreas1");
chart1.ChartAreas[0].AxisX.LabelStyle.ForeColor = Color.FromArgb(213, 216, 218);
chart1.ChartAreas[0].AxisX.LineColor = chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.Transparent;
chart1.ChartAreas[0].AxisX.LineDashStyle = chart1.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.Dot;
chart1.ChartAreas[0].AxisX.Minimum = 0D;
chart1.ChartAreas[0].AxisX.MajorTickMark.Enabled = false;
chart1.ChartAreas[0].AxisX.IsMarginVisible = false;
chart1.ChartAreas[0].CursorX.IsUserEnabled = true;
chart1.ChartAreas[0].CursorX.LineColor = Color.FromArgb(64, 64, 64);
chart1.ChartAreas[0].CursorX.LineDashStyle = ChartDashStyle.Dot;
chart1.ChartAreas[0].AxisY.LabelStyle.ForeColor = Color.FromArgb(213, 216, 218);
chart1.ChartAreas[0].AxisY.LineColor = chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.FromArgb(64, 64, 64);
chart1.ChartAreas[0].AxisY.LineDashStyle = chart1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dot;
chart1.ChartAreas[0].AxisY.Minimum = 0D;
chart1.ChartAreas[0].AxisY.MajorTickMark.Enabled = false;
chart1.ChartAreas[0].AxisY.LineWidth = 0;
chart1.ChartAreas[0].BackColor = Color.Transparent;
chart1.Legends.Add("Legends1");
chart1.Legends[0].Docking = Docking.Top;
chart1.Legends[0].Alignment = StringAlignment.Center;
chart1.Legends[0].Font = new Font("微软雅黑", 8F);
chart1.Legends[0].ForeColor = Color.FromArgb(213, 216, 218);
chart1.Legends[0].BackColor = Color.Transparent;
chart1.Legends[0].LegendStyle = LegendStyle.Row;
chart1.Series.Add("Series1");
chart1.Series[0].BackGradientStyle = GradientStyle.DiagonalRight;
chart1.Series[0].BorderColor = chart1.Series[0].Color = Color.FromArgb(26, 124, 237);
chart1.Series[0].BorderWidth = 2;
chart1.Series[0].ChartArea = "ChartAreas1";
chart1.Series[0].ChartType = SeriesChartType.Area;
chart1.Series[0].LabelForeColor = Color.Empty;
//chart1.Series[0].Points.Add(new DataPoint(0, 10));
//chart1.Series[0].Points.Add(new DataPoint(1, 20));
//chart1.Series[0].Points.Add(new DataPoint(2, 60));
//chart1.Series[0].Points.Add(new DataPoint(3, 30));
//chart1.Series[0].Points.Add(new DataPoint(4, 20));
//chart1.Series[0].Points.Add(new DataPoint(5, 10));
//chart1.Series.Add("Series2");
//chart1.Series[1].BackGradientStyle = GradientStyle.DiagonalRight;
//chart1.Series[1].BorderColor = chart1.Series[1].Color = Color.Cyan;
//chart1.Series[1].BorderWidth = 2;
//chart1.Series[1].ChartArea = "ChartAreas1";
//chart1.Series[1].ChartType = SeriesChartType.Area;
//chart1.Series[1].LabelForeColor = Color.Empty;
//chart1.Series[1].Points.Add(new DataPoint(0, 80));
//chart1.Series[1].Points.Add(new DataPoint(1, 70));
//chart1.Series[1].Points.Add(new DataPoint(2, 60));
//chart1.Series[1].Points.Add(new DataPoint(3, 10));
//chart1.Series[1].Points.Add(new DataPoint(4, 20));
//chart1.Series[1].Points.Add(new DataPoint(5, 30));
#endregion
#region 树状图
//chart1.BackColor = Color.FromArgb(0, 15, 31);
chart1.BackColor = Color.Transparent;
//chart1.ChartAreas.Clear();
//chart1.Series.Clear();
//chart1.Legends.Clear();
//chart1.ChartAreas.Add("ChartAreas1");
//chart1.ChartAreas[0].AxisX.LabelStyle.ForeColor = Color.FromArgb(213, 216, 218);
//chart1.ChartAreas[0].AxisX.LineColor = chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.Transparent;
//chart1.ChartAreas[0].AxisX.LineDashStyle = chart1.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.Dot;
//chart1.ChartAreas[0].AxisX.MajorTickMark.Enabled = false;
//chart1.ChartAreas[0].AxisX.IsMarginVisible = true;
//chart1.ChartAreas[0].AxisX.LabelStyle.IsEndLabelVisible = false;
//chart1.ChartAreas[0].CursorX.IsUserEnabled = true;
//chart1.ChartAreas[0].CursorX.LineColor = Color.FromArgb(64, 64, 64);
//chart1.ChartAreas[0].CursorX.LineDashStyle = ChartDashStyle.Dot;
//chart1.ChartAreas[0].AxisY.LabelStyle.ForeColor = Color.FromArgb(213, 216, 218);
//chart1.ChartAreas[0].AxisY.LineColor = chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.FromArgb(64, 64, 64);
//chart1.ChartAreas[0].AxisY.LineDashStyle = chart1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dot;
//chart1.ChartAreas[0].AxisY.MajorTickMark.Enabled = false;
//chart1.ChartAreas[0].AxisY.LineWidth = 0;
//chart1.ChartAreas[0].BackColor = Color.Transparent;
//chart1.Legends.Add("Legends1");
//chart1.Legends[0].Enabled = false;
//chart1.Legends[0].Docking = Docking.Top;
//chart1.Legends[0].Alignment = StringAlignment.Center;
//chart1.Legends[0].Font = new Font("微软雅黑", 8F);
//chart1.Legends[0].ForeColor = Color.FromArgb(213, 216, 218);
//chart1.Legends[0].BackColor = Color.Transparent;
//chart1.Legends[0].LegendStyle = LegendStyle.Row;
//chart1.Series.Add("Series1");
//chart1.Series[0].BackGradientStyle = GradientStyle.DiagonalLeft;
//chart1.Series[0].BorderColor = chart1.Series[0].Color = Color.FromArgb(26, 121, 232);
//chart1.Series[0].BorderWidth = 0;
//chart1.Series[0].BackSecondaryColor = Color.FromArgb(10, 26, 121, 232);
//chart1.Series[0].ChartArea = "ChartAreas1";
//chart1.Series[0].ChartType = SeriesChartType.Column;
//chart1.Series[0].LabelForeColor = Color.FromArgb(26, 121, 232);
//chart1.Series[0].IsValueShownAsLabel = true;
//chart1.Series[0].Points.AddXY("星期一", 10);
//chart1.Series[0].Points.AddXY("星期二", 20);
//chart1.Series[0].Points.AddXY("星期三", 60);
//chart1.Series[0].Points.AddXY("星期四", 30);
//chart1.Series[0].Points.AddXY("星期五", 20);
//chart1.Series.Add("Series2");
//chart1.Series[1].BackGradientStyle = GradientStyle.DiagonalLeft;
//chart1.Series[1].BorderColor = chart1.Series[1].Color = Color.FromArgb(37, 219, 228);
//chart1.Series[1].BorderWidth = 0;
//chart1.Series[1].BackSecondaryColor = Color.FromArgb(10, 26, 121, 232);
//chart1.Series[1].ChartArea = "ChartAreas1";
//chart1.Series[1].ChartType = SeriesChartType.Column;
//chart1.Series[1].LabelForeColor = Color.FromArgb(37, 219, 22);
//chart1.Series[1].IsValueShownAsLabel = true;
//chart1.Series[1].Points.AddXY("星期一", 80);
//chart1.Series[1].Points.AddXY("星期二", 70);
//chart1.Series[1].Points.AddXY("星期三", 60);
//chart1.Series[1].Points.AddXY("星期四", 10);
//chart1.Series[1].Points.AddXY("星期五", 20);
#endregion
#region 饼状图
//chart1.BackColor = Color.FromArgb(0, 15, 31);
chart1.BackColor = Color.Transparent;
//chart1.ChartAreas.Clear();
//chart1.Series.Clear();
//chart1.Legends.Clear();
//chart1.ChartAreas.Add("ChartAreas1");
//chart1.ChartAreas[0].Area3DStyle.Enable3D = true;
//chart1.ChartAreas[0].Area3DStyle.Inclination = 60;
//chart1.ChartAreas[0].BackColor = Color.Transparent;
//chart1.Legends.Add("Legends1");
//chart1.Legends[0].Alignment = StringAlignment.Center;
//chart1.Legends[0].Docking = Docking.Bottom;
//chart1.Legends[0].Font = new Font("微软雅黑", 8F);
//chart1.Legends[0].ForeColor = Color.FromArgb(213, 216, 218);
//chart1.Legends[0].BackColor = Color.Transparent;
//chart1.Legends[0].LegendStyle = LegendStyle.Table;
//chart1.Series.Add("Series1");
//chart1.Series[0].BorderColor = Color.FromArgb(40, 234, 244);
//chart1.Series[0].BorderWidth = 1;
//chart1.Series[0].ChartArea = "ChartAreas1";
//chart1.Series[0].ChartType = SeriesChartType.Doughnut;
//chart1.Series[0].LabelForeColor = Color.White;
//chart1.Series[0].IsValueShownAsLabel = true;
//chart1.Series[0].Points.AddXY("星期一", 10);
chart1.Series[0].Points[0].Color = Color.FromArgb(82, 229, 175);
//chart1.Series[0].Points.AddXY("星期二", 20);
chart1.Series[0].Points[1].Color = Color.FromArgb(143, 215, 251);
//chart1.Series[0].Points.AddXY("星期三", 60);
chart1.Series[0].Points[1].Color = Color.FromArgb(68, 104, 229);
//chart1.Series[0].Points.AddXY("星期四", 30);
chart1.Series[0].Points[1].Color = Color.FromArgb(235, 194, 62);
#endregion
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。