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


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

主题:图表

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/9/7 14:55:00 [显示全部帖子]

 

[此贴子已经被作者于2015/9/7 14:56:55编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/9/7 15:01:00 [显示全部帖子]

看不懂你什么意思,请上传具体例子

 

For Each c As DataCol In t.dataCols
    Select Case c.Name
        Case "派工耗时,待修耗时,维修耗时,待检耗时,检验耗时"
            Series = Chart.SeriesList.Add()
            Series.Text = c.Name
            Series.Length = t.Rows.Count
            For r As Integer = 0 To t.Rows.Count - 1
                Series.X(r) = r
                Series.Y(r) = val(t.Compute("Avg(" & c.Name & ")","[申请日期] = '" & t(r) & "'"))
            Next
    End Select
Next
For r As Integer = 0 To t.Rows.Count - 1
    Chart.AxisX.SetValueLabel(r, t.Rows(r)("申请日期"))                                                                                            
Next


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/9/7 19:53:00 [显示全部帖子]

Dim Chart As WinForm.Chart
Dim Series As WinForm.ChartSeries
Dim t As Table =  Tables("停机处置")
Chart = Forms("报表").Controls("Chart1")
Chart.ChartType = ChartTypeEnum.Bar
Chart.SeriesList.Clear()


For Each c As Col In t.cols
    Select Case c.Name
        Case "待派工耗时M","待维修耗时M","维修耗时M","待检验耗时M","检验耗时M","处置停机总耗时M"
            Series = Chart.SeriesList.Add()
            Series.Text = c.Name
            Series.Length = 12
            For i As Integer = 0 To 11
                Dim d As Date = new Date(Date.Today.Year, i+1, 1)
                Series.X(i) = i
                Series.Y(i) = val(t.Compute("Avg(" & c.Name & ")", "申请时间 >= #" & d & "# and 申请时间 < #" & d.AddMonths(1) & "#"))
                Chart.AxisX.SetValueLabel(i, Format(d, "yyyy-MM"))
            Next
    End Select
Next


Chart.AxisX.AnnoWithLabels = True
Chart.VisualEffect = True
Chart.LegendVisible = True
Chart.LegendCompass= CompassEnum.South


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/9/8 16:20:00 [显示全部帖子]

Dim Chart As WinForm.Chart
Dim Series As WinForm.ChartSeries
Dim t As Table =  Tables("停机处置")
Chart = Forms("报表").Controls("Chart1")
Chart.ChartType = ChartTypeEnum.Bar
Chart.SeriesList.Clear()
Chart.AxisX.ClearValueLabel

For Each c As Col In t.cols
    Select Case c.Name
        Case "待派工耗时M","待维修耗时M","维修耗时M","待检验耗时M","检验耗时M","处置停机总耗时M"
            Series = Chart.SeriesList.Add()
            Series.Text = c.Name
            Series.Length = 12
            Dim td As Date = new Date(Date.Today.Year, Date.Today.Month, 1)
            For i As Integer = 0 To 11
                Dim d = td.AddMonths(-i)
                Series.X(i) = i
                Series.Y(i) = val(t.Compute("Avg(" & c.Name & ")", "申请时间 >= #" & d & "# and 申请时间 < #" & d.AddMonths(1) & "#"))
                Chart.AxisX.SetValueLabel(i, Format(d, "yyyy-MM"))
            Next
    End Select
Next

Chart.AxisX.AnnoWithLabels = True
Chart.VisualEffect = True
Chart.LegendVisible = True
Chart.LegendCompass= CompassEnum.South

 


 回到顶部