基本情况统计表_tA 共三个字段 :年份 钢材消耗量 木材消耗量
有的年份 木材小消耗量为 0
按以下代码制成统计图表,两条曲线上均标上了消耗数据(包括数据为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