Dim Chart As WinForm.Chart
Dim Series As WinForm.ChartSeries
Dim t As Table = Tables("停机处置")
Dim q1 As Single = val(t.Compute("Avg(" & "待派工耗时M" & ")", "[待派工耗时M] > 0"))
Dim q2 As Single = val(t.Compute("Avg(" & "待维修耗时M" & ")", "[待维修耗时M] > 0"))
Dim q3 As Single = val(t.Compute("Avg(" & "维修耗时M" & ")", "[维修耗时M] > 0"))
Dim q4 As Single = val(t.Compute("Avg(" & "待检验耗时M" & ")", "[待检验耗时M] > 0"))
Dim q5 As Single = val(t.Compute("Avg(" & "检验耗时M" & ")", "[检验耗时M] > 0"))
Dim qq() As Single = {q1,q2,q3,q4,q5}
Dim ss() As String = {"待派工耗时M","待维修耗时M","维修耗时M","待检验耗时M","检验耗时M"}
Dim sm As Integer = t.Compute("Sum(qq)")
Chart= Forms("报表").Controls("Chart4")
Chart.VisualEffect = True
Chart.ChartType = ChartTypeEnum.Pie
For Each r As Row In t.Rows
Series = Chart.SeriesList.Add()
Series.Length = 1
Series.Text = r(" & ss & ") & "(" & r("qq") & ")"
Series.Y(0) = r("qq") '指定值
Series.DataLabelText = Math.Round(r("qq")*100/sm,2) & "%"
Next
Chart.LegendVisible = True
Chart.LegendCompass= CompassEnum.East '