Dim sj1 As Double = val(e.Form.Controls("TextBox12").text)
Dim sj2 As Double = val(e.Form.Controls("TextBox22").text)
Dim sj3 As Double = val(e.Form.Controls("TextBox32").text)
Dim sj4 As Double = val(e.Form.Controls("TextBox42").text)
Dim Chart1 As WinForm.Chart \'定义一个图表变量
Dim Series1 As WinForm.ChartSeries \'定义一个图系变量
Chart1= Forms("运动处方").Controls("Chart2") \' 引用窗口中的图表
Chart1.SeriesList.Clear
Chart1.VisualEffect = True \'加上这一行,让你的图表更漂亮
Chart1.ChartType = ChartTypeEnum.Pie \'图表1类型改为Bar(条形)
Series1 = Chart1.SeriesList.Add() \'增加一个图系
Series1.Length = 1 \'一个系列只能包括一个值
Series1.Text = "有氧运动"
Series1.Y(0) = sj1
Series1 = Chart1.SeriesList.Add() \'增加一个图系
Series1.Length = 1 \'一个系列只能包括一个值
Series1.Text = "力量运动"
Series1.Y(0) = sj2
Series1 = Chart1.SeriesList.Add() \'增加一个图系
Series1.Length = 1 \'一个系列只能包括一个值
Series1.Y(0) = sj3
Series1.Text = "柔韧运动"
Series1 = Chart1.SeriesList.Add() \'增加一个图系
Series1.Length = 1 \'一个系列只能包括一个值
Series1.Y(0) = sj4
Series1.Text = "日常活动"
Chart1.LegendVisible = False \'显示图列
Chart1.LegendCompass= CompassEnum.East \'图列显示在东方(右方)