都是一样的啊,例如:
Dim nd As WinForm.RadioButton = e.Form.Controls("按年度统计") '如果是按年
If nd.Checked = True Then
'--------------------------生成统计表------------------------
Dim g As New GroupTableBuilder("统计表1", DataTables("课程信息"))
g.Groups.AddDef("培训时间", DateGroupEnum.Year, "年")
g.Totals.AddDef("实际人数")
g.Totals.AddDef("人天统计")
g.Build()
DataTables("统计表1").DataCols.Add(" 新列",Gettype(Double),"人天统计/实际人数")
'------------------------生成图表----------------------------'
Dim Chart As WinForm.Chart '定义一个图表变量
Dim Series As WinForm.ChartSeries '定义一个图系变量
Chart = e.Form.Controls("Chart1") ' 引用窗口中的图表
'Chart.VisualEffect = True '加上这一行,让你的图表更漂亮
Chart.ChartType = ChartTypeEnum.Bar '图表1类型该为Bar(条形)
Chart.DataSource = "统计表1" '设置绑定表
Chart.SeriesList.Clear() '清除图表原来的图系
Chart.LegendVisible = True '显示图列
Chart.AxisX.Major = 1
Series = Chart.SeriesList.Add() '给图表1增加一个图系
Series.X.DataField = "年" 'X轴绑定到月份列
Series.Y.DataField = " 新列" 'Y轴绑定到数量列
Series.Text = "新列"
Series.DataLabelText = "{#YVAL}"
Chart.AxisY.Major = 50
Chart.LegendCompass= CompassEnum.South '图列显示在南方(底端)
Chart.AxisY.Text = "新列"
Series.DataLabelText = "{#YVAL}"
'---------------------------------------------
Chart.HeaderText = "实际人数--人天统计"
chart.AxisX.Text = "年份"
Else
Dim nf As WinForm.ComboBox = e.Form.Controls("选择年份")
nf.Enabled = True
nf.Value = "选择年份"
End If