你好,为什么有空行就生成不了图显示“未将对象引用设置到对象的实例”
Dim Chart As WinForm.Chart
Dim Series As WinForm.ChartSeries
Dim tbl As DataTable = DataTables("停机处置")
Dim lst As List(Of String) = tbl.GetValues("机器号")
Chart = e.Form.Controls("Chart1")
Chart.ChartType = ChartTypeEnum.Bar
Chart.SeriesList.Clear()
Series = Chart.SeriesList.Add()
Series.Length = lst.Count
For i As Integer = 0 To lst.Count - 1
Series.X(i) = i '指定水平坐标
Series.Y(i) = tbl.Compute("Avg(处置停机总耗时M)","[机器号] = '" & lst(i) & "'")
Chart.AxisX.SetValueLabel(i, lst(i))
Next