'''
Dim g As New GroupTableBuilder("统计表1", DataTables("品质积分"))
g.Groups.AddDef("责任部门")
g.Totals.AddDef("加减分")
g.Decimals = 1
g.Build()
'MainTable = Tables("统计表2")
Tables("统计表1").DataTable.DataCols.Add("积分", Gettype(Integer))
'Tables("统计表1").DataTable.DataCols.Add("年总概率", Gettype(Double))
For Each r As Row In Tables("统计表1").rows
r("积分") = r("加减分") + 100
Next
Dim Chart As WinForm.Chart '定义一个图表变量
Dim Series As WinForm.ChartSeries '定义一个图系变量
Chart= e.Form.Controls("Chart1") ' 引用窗口中的图表
Chart.ChartType = ChartTypeEnum.Bar '图表类型改为Bar(条形)
Dim t As Table = Tables("统计表1")
t.sort = "积分 DESC"
Chart.SeriesList.Clear() '清除图表原来的图系
Chart.AxisX.ClearValueLabel
series = Chart.SeriesList.Add
Series.Length = t.Rows.Count '设置图系的长度
For i As Integer = 0 To t.Rows.Count - 1 '指定每个数据点的位置
Series.X(i) = i '指定水平坐标
Series.Y(i) = t.Rows(i)("积分") '指定垂直坐标
Chart.AxisX.SetValueLabel(i, t.Rows(i)("责任部门")) '指定字符表示
Next
Chart.AxisX.AnnoWithLabels = True '启用字符标示
Series.DataLabelText = "{#YVAL}"
'Chart.VisualEffect = True '加上这一行,让你的图表更漂亮
‘Chart.LegendVisible = True '显示图列
'Chart.LegendText = "品质积分"
Chart.HeaderText = “部门积分”
Dim fnt As New Font("楷体",14,FontStyle.Bold)
Chart.Headerfont = fnt
Chart.LegendCompass= CompassEnum.South '图列显示在南方(底端)