Author |
Topic  |
|
Plutiko
8 Posts |
Posted - 12 Sep 2003 : 05:13:59
|
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
|
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. |
 |
|
Plutiko
8 Posts |
Posted - 15 Sep 2003 : 07:45:25
|
I managed this one. It was was indeed not a chart problem, but more a general programming problem. thx |
 |
|
|
Topic  |
|
|
|