Add data points from Double() array to existing VB.NET chart series

前端 未结 1 485
青春惊慌失措
青春惊慌失措 2020-12-22 07:50

I have an array of type Double() (1 x n) that I am trying to quickly plot on a graph I\'ve already set up. The only thing I want/need to do is take my

相关标签:
1条回答
  • 2020-12-22 08:48

    Adding the points should be as simple as

    Chart1.Series("Default").Points.Add(arrayName)
    

    As for it being auto-updated when you change the array, I believe if you just add the points, you are going to have an issue like pee in a swimming pool (once they are in there, you can't get them out). So, you add an array with 3 items, then add a double to the array, then the add to the chart again, you now incorrectly have 7 points. However, you can databind the array to the series, like so.

    Chart1.Series("Default").Points.DataBindXY(xStrings, xDoubles)
    

    In this case, if the array changes, the chart should change as well.

    0 讨论(0)
提交回复
热议问题