'''========市内入围编号趋势图======
Dim Chart1 As WinForm.Chart '定义一个图表变量
Dim Series1 As WinForm.ChartSeries '定义一个图系变量
Dim tbn As Table = Tables("抽签入围台帐_Table1") '定义一个变量t引用数据表
Chart1 = e.Form.Controls("Chart1") ' 引用窗口中的图表
Chart1.ChartType = ChartTypeEnum.Bar '设置图表类型
'Chart.ChartType = ChartTypeEnum.Histogram ' 设置图表类型
Chart1.SeriesList.Clear() '清除图表原来的图系
Chart1.AxisX.ClearValueLabel '清除所有通过SetValueLabel设置的数值字符标示
Series1 = Chart1.SeriesList.Add() '增加一个图系
Series1.Text = "市外入围编号趋势图" '图例名称命名
tbn.Sort = "市外入围_编号"
Dim cnt As Integer = tbn.DataTable.Compute("Max(市外入围_编号)")
Series1.Length = cnt+1
For ii As Integer = 1 To cnt ' t.Rows.Count - 1 '指定每个数据点的位置
Series1.X(ii) = ii '指定水平坐标
Series1.Y(ii) = 0
Next
For i As Integer = 0 To tbn.Rows.Count - 1 '指定每个数据点的位置
Series1.Y(tbn.Rows(i)("市外入围_编号")) = tbn.Rows(i)("市外入围_次数") '指定垂直坐标
Next
Dim bChart1 As C1.Win.C1Chart.C1Chart = Chart1.basecontrol '图标坐标轴如何设置字体颜色
Dim area1 = bChart1.ChartArea
area1.AxisX.ForeColor = Color.Red
area1.AxisY.ForeColor = Color.Blue
'Chart1.AxisX.AnnoWithLabels = True '启用字符标示
Chart1.LegendVisible = True '显示图列
Chart1.LegendCompass = CompassEnum.South '图列显示在南方(底端)
Chart1.AxisX.AnnoRotation = - 45 'X轴标示逆时针旋转45度
Dim fnt As New Font("黑体",9) '设置字体
Chart1.AxisX.Font = fnt
Chart1.SeriesList(0).FitType = FitTypeEnum.Spline '采用平滑线条
Dim lbls = bChart1.ChartLabels
For i As Integer = 1 To cnt ' t.Rows.Count - 1 '指定每个数据点的位置
Dim lbl As C1.Win.C1Chart.Label = lbls.LabelsCollection.AddNewLabel()
lbl.Text = iif(series1.y(i) = 0, "", series1.y(i) & "次")
lbl.AttachMethod = C1.Win.C1Chart.AttachMethodEnum.DataIndex
lbl.AttachMethodData.GroupIndex = 0
lbl.AttachMethodData.SeriesIndex = 0
lbl.AttachMethodData.PointIndex = i
lbl.Style.ForeColor = Color.Red
lbl.style.font = new font("宋体", 15)
lbl.Compass = LabelCompassEnum.South
lbl.Visible = True
Next