Dim Chart As WinForm.Chart '定义一个图表变量
Dim Series As WinForm.ChartSeries '定义一个图系变量
Chart= e.Form.Controls("Chart1")
' 引用窗口中的图表
Chart.DataSource = "叶轮性能数据" '设置绑定表
Chart.DataFilter = "叶轮型号='" & Tables("叶轮型号").current("叶轮型号") &
"'"
Chart.SeriesList.Clear() '清除图表原来的图系
Series = Chart.SeriesList.Add() '增加一个图系
Series.Text = "全压" '设置标题
Series.TooltipText = "流量Q: {#XVAL} m3/h, 全压pf: {#YVAL} Pa"
Chart.AxisX.Text = "流量 m3/h"
Series.X.DataField = "计算后流量" 'X轴绑定到流量列
Chart.AxisY.Text = "全压 Pa"
Series.Y.DataField = "计算后全压" 'Y轴绑定到全压列
Series.LineColor = Color.Red
Series.MarkShape = MarkShapeEnum.Box
Series.MarkColor = Color.Green
Series = Chart.SeriesList.Add() '增加第二个图系
Series.Text = "静压" '设置标题
Series.TooltipText = "流量Q:{#XVAL} m3/h, 静压psf: {#YVAL} Pa"
Series.X.DataField = "计算后流量" 'X轴绑定到流量列
Series.Y.DataField = "计算后静压" 'Y轴绑定到静压列
Series.LineColor = Color.DarkCyan
Series.MarkShape = MarkShapeEnum.Tri
Series.MarkColor = Color.Green
Chart.SeriesList(0).FitType =
FitTypeEnum.Spline
Chart.SeriesList2.Clear() '清除图表原来的图系
Series = Chart.SeriesList2.Add()'增加第二个图系
Series.Text = "轴功率" '设置标题
Series.TooltipText = "流量Q: {#XVAL} m3/h, 轴功率Pa: {#YVAL} KW"
Series.X.DataField = "计算后流量" '绑定
Series.Y.DataField = "计算后轴功率" '绑定
Chart.AxisY2.Text = "轴功率 KW"
Series.LineColor = Color.Blue
Series.MarkShape = MarkShapeEnum.Dot
Series.MarkColor = Color.Green
Chart.AxisY2.GridMajorVisible = False '隐藏Y2轴的网格线
Chart.LegendVisible = True '显示图列
Chart.LegendCompass= CompassEnum.East '图列显示在右方
Chart.SeriesList(0).FitType =
FitTypeEnum.Spline
Chart.SeriesList(1).FitType =
FitTypeEnum.Spline
e.Form.Controls("TextBox12").text
= Tables("叶轮性能数据").rows(0)("选定后的叶轮型号") '显示叶轮型号
e.Form.Controls("TextBox13").text
= Tables("叶轮型号").current("叶轮型号")