Foxtable(狐表)用户栏目专家坐堂 → 显示图表时能否出现滚动条


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

主题:显示图表时能否出现滚动条

帅哥,在线噢!
有点蓝
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107018 积分:544321 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2018/7/3 22:54:00 [只看该作者]

设置最后或者第一个,中间比较麻烦,还要计算有多少相同的

'---生成图表
Dim Chart As WinForm.Chart '定义一个图表变量
Dim Series As WinForm.ChartSeries '定义一个图系变量
Dim t As Table = Tables("发货产品统计") '定义一个变量t引用数据表
Chart = Forms("发货产品统计").Controls("Chart1") ' 引用窗口中的图表
If t.Rows.count * 12 >1000 Then
    Chart.Width = t.Rows.count * 12  '图表宽度
End If
Chart.ChartType = ChartTypeEnum.Bar '图表类型改为Bar(条形)
Chart.DataSource = "发货产品统计"  '设置绑定表
Chart.SeriesList.Clear() '清除图表原来的图系
For Each c As Col In t.Cols
    If c.Name <> "序号" Then
        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) = t.Rows(r)(c.Name)
        Next
        'Series.X.DataField = "序号" 'X轴绑定到产品列
        'Series.Y.DataField = c.Name '设置Y轴的绑定列
    End If
Next
Dim s As String = t.Rows(0)("序号")
For r As Integer = 0 To t.Rows.Count - 1
    If s = t.Rows(r)("序号") Then
        Chart.AxisX.SetValueLabel(r, "") '指定字符表示
    Else
        Chart.AxisX.SetValueLabel(r-1, s) '指定字符表示
        s = t.Rows(r)("序号")
    End If
Next
Chart.AxisX.AnnoWithLabels = True '启用字符标示
Chart.AxisX.AnnoRotation = - 90
Chart.VisualEffect = True '加上这一行,让你的图表更漂亮
Chart.LegendVisible = True '显示图列
Chart.LegendCompass= CompassEnum.North '图列显示在南方(底端)

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


加好友 发短信
等级:版主 帖子:1693 积分:12117 威望:0 精华:7 注册:2013/7/11 10:52:00
  发帖心情 Post By:2018/7/4 9:14:00 [只看该作者]


 回到顶部
总数 12 上一页 1 2