vb.net图表:如何删除鬼线 [英] vb.net chart : how to remove ghost lines

查看:136
本文介绍了vb.net图表:如何删除鬼线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的编码朋友

我正在使用微软图表和vb2008将一些数据绘制为样条曲线。我的数据正确绘制,但我得到一个不需要的行加入第一个和最后一个点。我想删除该行。有没有人可以帮我这个?

祝你好运

10118655



生成数据的vb代码

 公共  Sub  Plot31in()
' Depth1是X轴,SP1是Y轴
' Chart31in是表格的名称
' Chart1是MS Chart对象
Chart31in.Chart1.Series( SP)。Points.DataBindXY(Depth1,SP1)
对于 i As = IndexProcTop IndexProcBot
Chart31in.Chart1.Series( SP)。Poin ts.AddXY(Depth1(i),SP1(i))
下一步
结束 Sub





无法在此处添加屏幕截图,有人可以告诉我怎么做?

解决方案

自己得到了答案:插入'clear'语句。这是新代码:



 Chart31in.Chart1.Series(  SP)。Points.DataBindXY(Depth1,SP1)

Chart31in.Chart1.Series( SP)。Points.Clear()

对于 i 作为 = IndexProcTop IndexProcBot
Chart31in.Chart1.Series( SP)。Points.AddXY(Depth1(i) ),SP1(i))
下一步





谢谢看我的问题。


dear coder friends
i am using microsoft chart with vb2008 to plot some data as a spline. my data plots correctly but i get an unwanted line joining the first and last points. I want to remove the line. can anyone help me with this?
with best wishes
10118655

the vb code to generate data

Public Sub Plot31in()
'Depth1 is X axis, SP1 is Y axis
'Chart31in is name of the form
'Chart1 is the MS Chart object
    Chart31in.Chart1.Series("SP").Points.DataBindXY(Depth1, SP1)
     For i As Long = IndexProcTop To IndexProcBot
        Chart31in.Chart1.Series("SP").Points.AddXY(Depth1(i), SP1(i))
    Next
End Sub



Unable to add the screenshot here, can someone tell me how to do that ?

解决方案

Got the answer myself : inserted 'clear' statement. here's the new code :

Chart31in.Chart1.Series("SP").Points.DataBindXY(Depth1, SP1)

Chart31in.Chart1.Series("SP").Points.Clear()

For i As Long = IndexProcTop To IndexProcBot
    Chart31in.Chart1.Series("SP").Points.AddXY(Depth1(i), SP1(i))
Next



Thanks for looking at my question.


这篇关于vb.net图表:如何删除鬼线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆