If e.Node.Level = 1
Dim Chart As WinForm.Chart '定义一个图表变量
Dim Series As WinForm.ChartSeries '定义一个图系变量
Dim XLable As String
Dim i As Integer =0
Chart = e.Form.Controls("Chart1") ' 引用窗口中的图表
Chart.AxisY.Min = 0 '指定Y轴的最小值
Chart.AxisY.Max =120 '指定Y轴的最大值
Chart.ChartType = ChartTypeEnum.Bar '图表类型改为Bar(条形)
Chart.Stacked = True
Chart.AxisX.GridMajorVisible=True
Chart.AxisY.GridMajorVisible=True
Chart.AxisX.AnnoWithLabels = True
Chart.AxisX.AnnoRotation = -30
Chart.SeriesList.Clear() '清除图表原来的图系
Series = Chart.SeriesList.Add() '增加一个图系
Series.Text = "翻单产能" '设置图系的标题
Series.Length = DataTables("生产日历").Compute("Count(日期)","[月份]='" & e.Node.Name & "'")
'Series.DataLabelText = "{#YVAL}"
Series.FillColor = Color.Green
i=0
For Each r As DataRow In DataTables("生产日历").Select("月份='" & e.Node.Name & "'")
XLable = r("日期")
Series.X(i)= i
Series.Y(i)=int(r("产能系数")*r("翻单产能比例")*100)
Chart.AxisX.SetValueLabel(i, XLable)
i = i+1
Next
Series = Chart.SeriesList.Add() '增加一个图系
Series.Text = "首单产能" '设置图系的标题
Series.Length = DataTables("生产日历").Compute("Count(日期)","[月份]='" & e.Node.Name & "'")
Series.DataLabelText = "{#YVAL}"
Series.FillColor = Color.Blue
i=0
For Each r As DataRow In DataTables("生产日历").Select("月份='" & e.Node.Name & "'")
XLable = r("日期")
Series.X(i)= i
Series.Y(i)=int(r("产能系数")*(1-r("翻单产能比例"))*100)
Chart.AxisX.SetValueLabel(i, XLable)
i = i+1
Next
'------------------------
'Chart.VisualEffect = True '加上这一行,让你的图表更漂亮
Chart.LegendVisible = True '显示图列
Chart.LegendCompass= CompassEnum.South '图列显示在南方(底端)
End If