基本情况统计表_tA 共三个字段 :年份 钢材消耗量 木材消耗量
有的年份 木材小消耗量为 0
请教: 按以下代码制成统计图表,两条曲线上均标上消耗数据,如何修改代码,使得数据为0的不在图表上标识。
谢谢!
Dim ChartV As WinForm.Chart
Dim SeriesV As WinForm.ChartSeries
Dim tV As Table = Tables("基本情况统计表_tA")
ChartV = e.Form.Controls("Chart13")
ChartV.ChartType = ChartTypeEnum.XYPLOT'PIE
ChartV.SeriesList.Clear()
For Each cV As Col In tV.Cols
If cV.Name <> "年份" Then
SeriesV = ChartV.SeriesList.Add() '增加一个图系
SeriesV.Text = cV.Name '设置图系的标题
SeriesV.Length = tV.Rows.Count '设置图系的长度
For rV As Integer = 0 To tV.Rows.Count - 1
SeriesV.X(rV) = rV
SeriesV.Y(rV) = tV.Rows(rV)(cV.Name)
SeriesV.DataLabelCompass=LabelCompassEnum.NORTH
SeriesV.DataLabelText = "{#YVAL}"
SeriesV.DataLabelForeColor=ColoR.GREEN
Next
End If
Next
For rV As Integer = 0 To tV.Rows.Count - 1
ChartV.AxisX.SetValueLabel(rV, tV.Rows(rV)("年份"))
Next