以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 图表 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=74134) |
-- 作者:cqlistone -- 发布时间:2015/9/3 13:02:00 -- 图表 你好,为什么有空行就生成不了图显示“未将对象引用设置到对象的实例” 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
|
-- 作者:大红袍 -- 发布时间:2015/9/4 9:43:00 -- Dim Chart As WinForm.Chart
Dim Series As WinForm.ChartSeries
Dim tbl As DataTable = DataTables("停机处置")
Dim lst As List(Of String) = tbl.GetValues("机器号", "机器号 is not null")
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
|