1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
| cht4.Titles.Add("交通违法行为TOP5"); cht4.Titles[0].ForeColor = Color.Black; cht4.Titles[0].Font = new Font("微软雅黑", 12f, FontStyle.Regular); cht4.Titles[0].Alignment = ContentAlignment.TopCenter; cht4.Titles.Add("合计:25412 宗 "); cht4.Titles[1].ForeColor = Color.Black; cht4.Titles[1].Font = new Font("微软雅黑", 8f, FontStyle.Regular); cht4.Titles[1].Alignment = ContentAlignment.TopRight;
cht4.BackColor = Color.Transparent; cht4.ChartAreas[0].BackColor = Color.Transparent; cht4.ChartAreas[0].BorderColor = Color.Transparent; cht4.ChartAreas[0].AxisX.Interval = 1; cht4.ChartAreas[0].AxisX.LabelStyle.IsStaggered = true; cht4.ChartAreas[0].AxisX.LabelStyle.Angle = -45; cht4.ChartAreas[0].AxisX.TitleFont = new Font("微软雅黑", 14f, FontStyle.Regular); cht4.ChartAreas[0].AxisX.TitleForeColor = Color.Black;
cht4.ChartAreas[0].AxisX.LineColor = ColorTranslator.FromHtml("#38587a"); ; cht4.ChartAreas[0].AxisX.LabelStyle.ForeColor = Color.Black; cht4.ChartAreas[0].AxisX.LabelStyle.Font = new Font("微软雅黑", 10f, FontStyle.Regular); cht4.ChartAreas[0].AxisX.MajorGrid.Enabled = true; cht4.ChartAreas[0].AxisX.MajorGrid.LineColor = ColorTranslator.FromHtml("#2c4c6d");
cht4.ChartAreas[0].AxisY.LineColor = ColorTranslator.FromHtml("#38587a"); cht4.ChartAreas[0].AxisY.LabelStyle.ForeColor = Color.Black; cht4.ChartAreas[0].AxisY.LabelStyle.Font = new Font("微软雅黑", 10f, FontStyle.Regular); cht4.ChartAreas[0].AxisY.MajorGrid.Enabled = true; cht4.ChartAreas[0].AxisY.MajorGrid.LineColor = ColorTranslator.FromHtml("#2c4c6d");
cht4.ChartAreas[0].AxisY2.LineColor = Color.Transparent; cht4.ChartAreas[0].AxisX.IsMarginVisible = false; cht4.ChartAreas[0].Area3DStyle.Enable3D = true; cht4.ChartAreas[0].AxisX.IsInterlaced = false; cht4.ChartAreas[0].AxisX.IsMarginVisible = false; cht4.ChartAreas[0].AxisY.MajorTickMark.Enabled = false; cht4.ChartAreas[0].AxisY.LabelStyle.Enabled = false; cht4.ChartAreas[0].BackGradientStyle = GradientStyle.None;
Legend legend4 = new Legend(); legend4.Title = "图例"; legend4.TitleBackColor = Color.Transparent; legend4.BackColor = Color.Transparent; legend4.TitleForeColor = Color.Black; legend4.TitleFont = new Font("微软雅黑", 10f, FontStyle.Regular); legend4.Font = new Font("微软雅黑", 8f, FontStyle.Regular); legend4.ForeColor = Color.Black; cht4.Legends.Add(legend4); cht4.Legends[0].Position.Auto = true;
cht4.Series[0].XValueType = ChartValueType.String; cht4.Series[0].Label = "#VAL"; cht4.Series[0].LabelForeColor = Color.Black; cht4.Series[0].ToolTip = "#LEGENDTEXT:#VAL(宗)"; cht4.Series[0].ChartType = SeriesChartType.Radar; cht4.Series[0]["RadarDrawingStyle"] = "Line"; cht4.Series[0].LegendText = "2015年"; cht4.Series[0].IsValueShownAsLabel = true;
cht4.Series.Add(new Series("Series2")); cht4.Series[1].Label = "#VAL"; cht4.Series[1].LabelForeColor = Color.Black; cht4.Series[1].ToolTip = "#LEGENDTEXT:#VAL(宗)"; cht4.Series[1].ChartType = SeriesChartType.Radar; cht4.Series[1]["RadarDrawingStyle"] = "Line"; cht4.Series[1].LegendText = "2016年"; cht4.Series[1].IsValueShownAsLabel = true;
cht4.Series.Add(new Series("Series3")); cht4.Series[2].Label = "#VAL"; cht4.Series[2].LabelForeColor = Color.Black; cht4.Series[2].ToolTip = "#LEGENDTEXT:#VAL(宗)"; cht4.Series[2].ChartType = SeriesChartType.Radar; cht4.Series[2]["RadarDrawingStyle"] = "Line"; cht4.Series[2].LegendText = "2017年"; cht4.Series[2].IsValueShownAsLabel = true;
double[] yValues = { 65.62, 75.54, 60.45, 34.73, 85.42, 55.9, 63.6, 55.2, 77.1 }; string[] xValues = { "France", "Canada", "Germany", "USA", "Italy", "Spain", "Russia", "Sweden", "Japan" };
double[] y2 = { 45.62, 65.54, 70.45, 84.73, 35.42, 55.9, 63.6 }; double[] y3 = { 88.62, 35.54, 52.45, 45.73, 88.42, 14.9, 33.6 }; this.cht4.Series[0].Points.DataBindXY(xValues, yValues); this.cht4.Series[1].Points.DataBindY(y2); this.cht4.Series[2].Points.DataBindY(y3);
cht4.ChartAreas[0].AxisX.LabelStyle.Interval = 1; cht4.ChartAreas[0].AxisX.TitleAlignment = StringAlignment.Near;
for (int i = 0; i < cht4.Series[2].Points.Count; i++) { cht4.Series[2].Points[i].MarkerStyle = MarkerStyle.Circle; cht4.Series[2].Points[i].MarkerColor = Color.Red; } for (int i = 0; i < cht4.Series.Count; i++) { for (int j = 0; j < cht4.Series[i].Points.Count; j++) { cht4.Series[i].Points[j].Label = " "; } } cht4.AntiAliasing = AntiAliasingStyles.All; cht4.Palette = ChartColorPalette.BrightPastel;
cht4.Series[0].ChartType = SeriesChartType.Radar; cht4.Series[1].ChartType = SeriesChartType.Radar; cht4.Series[2].ChartType = SeriesChartType.Radar; cht4.Width = 500; cht4.Height = 350;
}
|