Dim Chart As WinForm.Chart '定义一个图表变量 Dim Series As WinForm.ChartSeries '定义一个图系变量 Chart= Forms("窗口1").Controls("Chart1") ' 引用窗口中的图表 Chart.ChartType = ChartTypeEnum.Hilo '设置图表类型 Chart.SeriesList.Clear() '清除图表原来的图系 Series = Chart.SeriesList.Add() '增加一个图系 Series.LineThickNess = 5 '设置线条宽度 Dim t As Table = Tables("表A") Series.Length = t.Rows.Count '图系包括10个数据点 For i As Integer = 0 To t.Rows.Count -1 '指定每个数据点的位置 Series.X(i) = i '指定水平坐标 Series.Y(i) = t.rows(i)("长度") '生成最大值 Series.Y1(i) = t.rows(i)("长度2")'生成最小值 Chart.AxisX.SetValueLabel(i, t.Rows(i)("时刻")) '指定字符表示 Next Chart.AxisX.AnnoWithLabels = True '启用字符标示
|