怎么把图表的,数量_1,数量_2,数量_3, 数量_4,显示为表中的:SENSOR,倒车主机,显示模块,中控主机,
下面的代码怎么改
Dim g As New CrossTableBuilder("统计表1", DataTables("维修记录"))
g.HGroups.AddDef("日期", "月")
g.VGroups.AddDef("类别")
g.Totals.AddDef("数量", AggregateEnum.Sum , "数量")
e.Form.controls("Table1").Table.datasource = g.BuildDataSource
Dim Chart As WinForm.Chart '定义一个图表变量
Dim Series As WinForm.ChartSeries '定义一个图系变量
Dim t As Table = e.Form.controls("Table1").Table '定义一个变量t引用数据表
Chart = e.Form.Controls("Chart1") ' 引用窗口中的图表
Chart.ChartType = ChartTypeEnum.Bar '图表类型改为Bar(条形)
Chart.DataSource = t.Name '设置绑定表
Chart.SeriesList.Clear() '清除图表原来的图系
For Each c As Col In t.Cols
If c.Name <> "月" Then
Series = Chart.SeriesList.Add() '增加一个图系
Series.Text = c.Name '设置图系的标题
Series.X.DataField = "月" 'X轴绑定到产品列
Series.Y.DataField = c.Name '设置Y轴的绑定列
End If
Next
Chart.Stacked = True
Chart.VisualEffect = True '加上这一行,让你的图表更漂亮
Chart.LegendVisible = True '显示图列
Chart.LegendCompass= CompassEnum.South '图列显示在南方(底端)
此主题相关图片如下:图表.jpg