1. ## Charting & webform1.aspx.vb

webform.aspx has the following code:
Code:
<asp:Chart ID="Chart1" BackColor="Black" runat="server">
<Series>
<asp:Series Name="Series1" ChartType="Line" BorderWidth="1"></asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="true">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
I would like to know the mechanics of plotting this chart with data calculated from within: webform.aspx.vb. I have calculated the data.

How do you plot the chart?

Code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'calculate data
'plot chart
End Sub

2. Here is my 'plot chart in webform.aspx.vb the graph should be a circle.

How do you convert Double to System.Collections.IEnumerable

x&y are double
DatabindXY is of IEnumerable

Code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim x, y
For t = 0 To 2 * 3.1459 Step 0.1
x = Math.Cos(t)
y = Math.Sin(t)
Chart1.Series("Series1").Points.DataBindXY(x,y)
Chart1.Series("Series1").IsVisibleInLegend = true
Chart1.Series("Series1").IsValueShownAsLabel = true;
Chart1.Series("Series1").Color = System.Drawing.Color.Red;
Next t
End Sub

3. I think this is what you want... (pardon my typos/compile errors, I haven't done VB for a while)

Code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim x As List(Of Double) = new List(Of Double), y As List(Of Double) = new List(Of Double)
For t = 0 To 2 * 3.1459 Step 0.1
Next t
Chart1.Series("Series1").Points.DataBindXY(x,y)
Chart1.Series("Series1").IsVisibleInLegend = true
Chart1.Series("Series1").IsValueShownAsLabel = true;
Chart1.Series("Series1").Color = System.Drawing.Color.Red;
End Sub

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•