Foxtable(狐表)用户栏目专家坐堂 → 图表数据点请教


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

主题:图表数据点请教

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


加好友 发短信
等级:狐神 帖子:5061 积分:13092 威望:0 精华:0 注册:2014/5/15 21:34:00
图表数据点请教  发帖心情 Post By:2015/10/14 15:23:00 [只看该作者]

大师:数据点及连接线明明设置一样,显示就不不一样什么鬼?

Dim tx As  Integer
Dim Chart As WinForm.Chart '定义一个图表变量
Dim Series As WinForm.ChartSeries '定义一个图系变量
Dim t As Table = dt.Table '定义一个变量t引用数据表
Chart = e.Form.Controls("Chart2") ' 引用窗口中的图表


Select Case comb11.Text
    Case "趋势线型"
        tx = ChartTypeEnum.XYPlot
    Case "直方条型"
        tx = ChartTypeEnum.bar
    Case "饼型"
        tx = ChartTypeEnum.pie
End Select
Chart.ChartType = tx
Chart.SeriesList.Clear() '清除图表原来的图系
For Each r As Row In t.Rows 
    Series = Chart.SeriesList.Add() '增加一个图系
    Series.Text = r("分析指标") '设置图系的标题
    Series.Length = t.Cols.count - 1 '设置图系的长度
    For  c As Integer = 1 To t.Cols.Count -1
        Series.X(c-1) =   c
        Series.Y(c-1) = r(c)
    Next
Next
For  c As Integer = 1 To t.Cols.Count -1
    Chart.AxisX.SetValueLabel(c, t.Cols(c).name) '指定字符表示
Next
Chart.AxisX.AnnoWithLabels = True '启用字符标示
Chart.VisualEffect = True '加上这一行,让你的图表更漂亮
Chart.LegendVisible = True '显示图列
Chart.LegendCompass = CompassEnum.south

For ts As Integer = 0 To t.rows.count -1
    
    Select Case ts
        Case 0,3,7,11,15
            Series.marksize = 1
            series.LineThickNess = 0.2
            Series.FitType = FitTypeEnum.Line
            Series.LineColor= Color.Red
            Series.MarkColor = Color.Green
            Series.MarkShape = MarkShapeEnum.Dot
            Series.MarkSize = 1
        Case 1,4,8,12,16
            Series.marksize = 1
            series.LineThickNess = 0.2
            Series.FitType = FitTypeEnum.Line
            Series.LineColor= Color.blue
            Series.MarkColor = Color.Green
            Series.MarkShape = MarkShapeEnum.Dot
            Series.MarkSize = 1
        Case 2,5,9,13
            Series.marksize = 1
            series.LineThickNess = 0.2
            Series.FitType = FitTypeEnum.Line
            Series.LineColor= Color.green
            Series.MarkColor = Color.red
            Series.MarkShape = MarkShapeEnum.Dot
            Series.MarkSize = 1
        Case Else
            Series.marksize = 1
            series.LineThickNess = 0.2
            Series.FitType = FitTypeEnum.Line
            Series.LineColor= Color.black
            Series.MarkColor = Color.Green
            Series.MarkShape = MarkShapeEnum.Dot
            Series.MarkSize = 1
    End Select
Next



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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/10/14 15:25:00 [只看该作者]

例子发上来测试。

 回到顶部