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 = q1+q2+q3+q4+q5 Chart= Forms("报表").Controls("Chart4") Chart.VisualEffect = True Chart.ChartType = ChartTypeEnum.Pie For i As Integer = 0 to ss.length -1 Series = Chart.SeriesList.Add() Series.Length = 1 Series.Text = ss(i) & "(" & qq(i) & ")" Series.Y(0) = qq(i) '指定值 Series.DataLabelText = Math.Round(qq(i)*100/sm,2) & "%" Next Chart.LegendVisible = True Chart.LegendCompass= CompassEnum.East '
|