Double to System.Collections.IEnumerable [英] Double to System.Collections.IEnumerable

查看:59
本文介绍了Double to System.Collections.IEnumerable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要绘制一个点列表,我必须从Double转到System.Collections.IEnumerable



如何将xcircle和ycircle初始化为IEnumerable?



To graph a list of points I you have to go from Double to System.Collections.IEnumerable

How do you initialize xcircle and ycircle to be IEnumerable?

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim x, y, xcircle(360), ycircle(360)
    For t = 0 To 360 Step 1
        x = Math.Cos(t * Math.PI / 180)
        y = Math.Sin(t * Math.PI / 180)
        xcircle(t) = x
        ycircle(t) = y
    Next t
    Chart1.Series("Series1").Points.DataBindXY(xcircle, ycircle)
    Chart1.Series("Series1").IsVisibleInLegend = True
    Chart1.Series("Series1").IsValueShownAsLabel = True
    Chart1.Series("Series1").Color = System.Drawing.Color.Red
End Sub

推荐答案

xcircle ycircle 在您的代码中声明为数组 - 这意味着它们已经实现了IEnumerable。



但是,也许你宣布它们作为双打数组?

xcircle and ycircle are declared in your code as arrays - which means they already implement IEnumerable.

However, perhaps if you declared them as arrays of doubles?
Dim xcircle As Double() = New Double(360){}
Dim ycircle As Double() = New Double(360){}


这篇关于Double to System.Collections.IEnumerable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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