BT3...
Y2金额列显示不了,另外图例里的series 0表示什么?怎么修改啊?
数据标示,Y2也要显示出来。
另外我试了一下,把月份的数据类型改为短整型就会报错,怎么让它在短整的时候不再报错呢?
Dim Chart As WinForm.Chart '定义一个图表变量
Dim Series As WinForm.ChartSeries '定义一个图系变量
Chart = e.Form.Controls("Chart1") ' 引用窗口中的图表
Chart.VisualEffect = True '加上这一行,让你的图表更漂亮
Chart.ChartType = ChartTypeEnum.xyplot '图表1类型该为Bar(条形)
'Chart.ChartType2 = ChartTypeEnum.XYPlot '图表2类型该为线形
Chart.DataSource = "库存表" '设置绑定表
Chart.SeriesList.Clear() '清除图表原来的图系
Series = Chart.SeriesList.Add() '给图表1增加一个图系
Series = Chart.SeriesList.Add() '增加一个图系
series.marksize= 2 '数据标记点的大小
Series.TooltipText = "数量= {#YVAL}"
Series.Text = "数量"
Series.X.DataField = "月份" 'X轴绑定到产品列
Series.Y.DataField = "数量" 'Y轴绑定到数量列
''Series.Y1.DataField = "金额" 'Y轴绑定到金额列
Chart.SeriesList2.Clear() '清除图表原来的图系
Series = Chart.SeriesList2.Add() '给图表2增加一个图系
series.marksize= 2 '数据标记点的大小
Series.Text = "金额(元)"
Series.X.DataField = "月份" 'X轴绑定到产品列
Series.Y2.DataField = "金额" 'Y轴绑定到数量列
Chart.LegendVisible = True '显示图列
Chart.LegendCompass= CompassEnum.South '图列显示在南方(底端)
Chart.AxisX.Text = "月份"
Chart.AxisY.Text = "数量"
Chart.AxisY2.Text = "金额"
Chart.BarClusterWidth = 10
Chart.BarClusterWidth2 = 10
Chart.AxisX.AnnoRotation = - 45 'X轴标示逆时针旋转45度
Series.TooltipText = "金额 = {#Y2VAL} "