Dim Chart As WinForm.Chart
Dim Series As WinForm.ChartSeries
Chart = e.Form.Controls("Chart2")
Chart.VisualEffect = True
Chart.ChartType = ChartTypeEnum.Bar
Chart.DataSource = "熔炼效率"
Chart.SeriesList.Clear()
Series = Chart.SeriesList.Add()
Series.Text = "一班熔速"
Series.X.DataField = "铸锭批号"
Series.Y.DataField = "熔炼1_熔速kgph"
或者这样
Dim Chart As WinForm.Chart
Dim Series As WinForm.ChartSeries
Chart = e.Form.Controls("Chart2")
Chart.VisualEffect = True
Chart.ChartType = ChartTypeEnum.Bar
dim t as table = tables("熔炼效率")
Chart.SeriesList.Clear()
Series = Chart.SeriesList.Add()
Series.Text = "一班熔速"
Series.Length = t.Rows.Count '设置图系的长度
For i As Integer = 0 To t.Rows.Count - 1 '指定每个数据点的位置
Series.X(i) = i '指定水平坐标
Series.Y(i) = t.Rows(i)("熔炼1_熔速kgph") '指定垂直坐标
Chart.AxisX.SetValueLabel(i, t.Rows(i)("铸锭批号")) '指定字符表示
Next
Chart.AxisX.AnnoWithLabels = True
[此贴子已经被作者于2018/2/6 16:16:38编辑过]