-- 作者:keeryq
-- 发布时间:2013/3/8 18:01:00
-- 分析图
Dim g As New CrossTableBuilder("统计表1", DataTables("课程信息")) g.HGroups.AddDef("培训时间", DateGroupEnum.Year, "年") g.VGroups.AddDef("课程") \'g.Totals.AddDef("实际人数", "实际人数") g.Totals.AddDef("人天统计", "人天统计") g.Build()
\'-----------------------------------生成图表---------------------- Dim Chart As WinForm.Chart \'定义一个图表变量 Dim Series As WinForm.ChartSeries \'定义一个图系变量 Dim t As Table = Tables("统计表1") \'定义一个变量t引用数据表 Chart = e.Form.Controls("Chart1") \' 引用窗口中的图表 Chart.ChartType = ChartTypeEnum.Bar \'图表类型改为Bar(条形) Chart.DataSource = "统计表1" \'设置绑定表 Chart.SeriesList.Clear() \'清除图表原来的图系 chart.AxisX.Major = 1 Chart.AxisY.Major = 100 For Each c As Col In t.Cols If c.Name <> "年" Then Series = Chart.SeriesList.Add() \'增加一个图系 Series.Text = c.Caption \'Name \'设置图系的标题 Series.X.DataField = "年" \'X轴绑定到产品列 Series.Y.DataField = c.Name \'设置Y轴的绑定列 Series.DataLabelText = "{#YVAL}" End If Next \'Chart.VisualEffect = True \'加上这一行,让你的图表更漂亮 Chart.LegendVisible = True \'显示图列 Chart.LegendCompass= CompassEnum.South \'图列显示在南方(底端) 这是区分课程的代码 但是怎么加入折线的数据呢 此主题相关图片如下:qq截图20130308175746.png
此主题相关图片如下:qq截图20130308175852.png
|