Foxtable(狐表)用户栏目专家坐堂 → 饼图


  共有2361人关注过本帖树形打印复制链接

主题:饼图

帅哥哟,离线,有人找我吗?
cqlistone
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:58 积分:713 威望:0 精华:0 注册:2015/5/11 20:47:00
饼图  发帖心情 Post By:2015/9/13 21:32:00 [显示全部帖子]

"待派工耗时M","待维修耗时M","维修耗时M","待检验耗时M","检验耗时M"是表的列名,求这些列的饼图

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 '

 回到顶部