Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 existing arrays to chart
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Plutiko

8 Posts

Posted - 12 Sep 2003 :  05:13:59  Show Profile  Reply with Quote
Hello

How can you pass existing arrays(ar1, ar2) to a chart. I don't know how to do it.

Public Class Form1
Inherits System.Windows.Forms.Form

Dim ar1() As Double = {10, 11, 12, 13}
Dim ar2() As Double = {100, 110, 120, 130}

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myForm As New Form2()
myForm.Laden(ar1, ar2)
myForm.Show()
End Sub
End Class

Public Class Form2
Inherits System.Windows.Forms.Form

Public Sub Laden(ByVal nar1() As Double, ByVal nar2() As Double)
Dim objMyChart As New ChartView()
objMyChart.x = nar1
objMyChart.y = nar2

End Sub

Private Sub ChartView1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChartView1.Load

End Sub
End Class

Imports com.quinncurtis.chart2dnet
Imports System.Drawing
Imports System.Drawing.Drawing2D

Public Class ChartView
Inherits com.quinncurtis.chart2dnet.ChartView

Public x() As Double
Public y() As Double

Private Sub ChartView_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
InitializeChart()
End Sub

Private Sub InitializeChart()
Dim Dataset1 As New SimpleDataset("First", x, y)
End Sub

Thank you, Plutiko

quinncurtis

1164 Posts

Posted - 12 Sep 2003 :  09:21:49  Show Profile  Reply with Quote
I'm confused by your example. Is this supposed to be a complete example? Where is the chart created? Creating a ChartView does not create a chart, it only creates the window or form that chart objects are added to.

Look at the example program UserChartExample1. It creates datasets using one x and three y arrays. Modify that example to demonstrate your problem. There are dozens of other examples in the ChartTabDemo example program.
Go to Top of Page

Plutiko

8 Posts

Posted - 15 Sep 2003 :  07:45:25  Show Profile  Reply with Quote
I managed this one. It was was indeed not a chart problem, but more a general programming problem.
thx
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07