代码如下,效果如附档图片,为什么在图表下面不是显示
1月,2月,3月等,而是显示金额_1..................
代码要怎么样修改
Dim g As New CrossTableBuilder("业务月份统计", DataTables("订单明细"))
g.HGroups.AddDef("业务员")
g.VGroups.AddDef("出货日期", "{0}月")
g.Totals.AddDef("金额", "金额")
g.Build()
'MainTable = Tables("统计表4")
Tables("统计_统计表").DataSource = DataTables("业务月份统计")
Dim Chart As WinForm.Chart '定义一个图表变量
Dim Series As WinForm.ChartSeries '定义一个图系变量
Dim t As Table = Tables("业务月份统计") '定义一个变量t引用数据表
Chart = e.Form.Controls("Chart1") ' 引用窗口中的图表
Chart.ChartType = ChartTypeEnum.Bar '图表类型改为Bar(条形)
Chart.SeriesList.Clear() '清除图表原来的图系
For Each c As Col In t.Cols
If c.Name <> "业务员" Then
Series = Chart.SeriesList.Add() '增加一个图系
Series.Text = c.Name '设置图系的标题
Series.Length = t.Rows.Count '设置图系的长度
For r As Integer = 0 To t.Rows.Count - 1
Series.X(r) = r
Series.Y(r) = t.Rows(r)(c.Name)
Next
End If
Next
For r As Integer = 0 To t.Rows.Count - 1
Chart.AxisX.SetValueLabel(r, t.Rows(r)("业务员")) '指定字符表示
Next
Chart.AxisX.AnnoWithLabels = True '启用字符标示
Chart.VisualEffect = True '加上这一行,让你的图表更漂亮
Chart.LegendVisible = True '显示图列
Chart.LegendCompass= CompassEnum.South '图列显示在南方(底端)
此主题相关图片如下:2.png
此主题相关图片如下:3.png