以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]如何去除所有数据点的标记(已解决)  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=160276)

--  作者:yyzlxc
--  发布时间:2021/1/27 11:54:00
--  [求助]如何去除所有数据点的标记(已解决)
下面是一段图表生成代码,Y轴有五组数据,如何去除所有数据点的标记,请各位老师指教,谢谢!!
(现在只能清除一组数据的标记)

Dim Chart As WinForm.Chart \'定义一个图表变量
Dim Series As WinForm.ChartSeries \'定义一个图系变量
Dim t As Table = Tables("历史数据3") \'定义一个变量t引用数据表
Chart = Forms("窗口2").Controls("Chart2") \' 引用窗口中的图表
Chart.ChartType = ChartTypeEnum.XYPlot \'图表类型改为Bar(条形)
Chart.DataSource = "历史数据3" \'设置绑定表
Dim max As Single = t.Compute("Max(MA5)")
Dim min As Single = t.Compute("Min(MA5)")
chart.AxisX.ClearValueLabel
Chart.AxisX.Text = "日期"
Chart.AxisY.Text = "MA值"
Chart.AxisY.Min = min \'指定Y轴的最小值
Chart.AxisY.Max = max \'指定Y轴的最大值
Chart.SeriesList.Clear() \'清除图表原来的图系
For Each c As Col In t.Cols
    If c.Name <> "日期" Then
        If c.Name <> "序号" Then
            Series = Chart.SeriesList.Add() \'增加一个图系
            Series.Text = c.Name \'设置图系的标题
            Series.X.DataField = "序号" \'X轴绑定到产品列
            Series.Y.DataField = c.Name \'设置Y轴的绑定列
        End If
    End If
Next
For i As Integer = 0 To nn2
    If i Mod 5 = 0 Then
        Chart.AxisX.SetValueLabel(i, t.Rows(i)("日期"))
    End If
Next
Chart.AxisX.AnnoWithLabels = True
Chart.LegendVisible = True \'显示图列
Chart.LegendCompass= CompassEnum.South \'图列显示在南方(底端)
Chart.SeriesList(0).LineColor = Color.Red \'设置连线的颜色
Chart.SeriesList(1).LineColor = Color.Cyan
Chart.SeriesList(2).LineColor = Color.Green
Chart.SeriesList(3).LineColor = Color.DarkOrange
Chart.SeriesList(4).LineColor = Color.Blue
Series.MarkShape = MarkShapeEnum.None \'数据点标记的形状
[此贴子已经被作者于2021/1/27 12:00:32编辑过]

--  作者:有点蓝
--  发布时间:2021/1/27 11:57:00
--  
For Each c As Col In t.Cols
    If c.Name <> "日期" Then
        If c.Name <> "序号" Then
            Series = Chart.SeriesList.Add() \'增加一个图系
Series.MarkShape = MarkShapeEnum.None \'数据点标记的形状
            Series.Text = c.Name \'设置图系的标题
            Series.X.DataField = "序号" \'X轴绑定到产品列
            Series.Y.DataField = c.Name \'设置Y轴的绑定列
        End If
    End If
Next

--  作者:yyzlxc
--  发布时间:2021/1/27 12:00:00
--  
谢谢有点蓝老师,问题解决。