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#)
 SetDataset Issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

wlc

4 Posts

Posted - 10 Sep 2003 :  22:09:20  Show Profile  Reply with Quote
1. i dragged a UserChartControl1 to form1 and added a button
2. in the class UserChart Control i added methods to get
references to objects Plot1 and Plot2
3. then in Form1.Button1_Click i construct x1,y1,y2,and

Dim Datasetx As New SimpleDataset("xxx", x1, y1)
Dim Datasety As New SimpleDataset("yyy", x1, y2)

i can then update the chart on Form1 by calling

Dim plot2 As SimpleLinePlot
plot2 = Me.UserChartControl11.Plot2
plot2.SetDataset(Datasetx)
Me.UserChartControl11.UpdateDraw()

this works ok -- i can update the plot by pushing the button

4. unfortunately this technique does not work for plot1 ie

Dim plot1 As SimpleScatterPlot
plot1 = Me.UserChartControl11.Plot1
plot1.SetDataset(Datasety)
Me.userChartcontrol11.UpdateDraw()

i get error message

"object reference not set to instance of object"

5. so -- how do i access a valid reference to object plot1
from Form1 so i can call SetDataset?




bill clarke

quinncurtis

1164 Posts

Posted - 11 Sep 2003 :  09:36:28  Show Profile  Reply with Quote
Your basic technique looks ok. I am sure that it just your implementation that has an error.

Use the debugger to check the value of the value returned by your
call to

plot1 = Me.UserChartControl11.Plot1

You will probably find that plot1 one is null.

Why would the value of Me.UserChartControl11.Plot1 be null ?

This would be an error in your Me.UserChartControl11.Plot1 class.
My guess is that you either failed to assign the value of Plot1 correctly, or you have both local and global copies of the variable and assign the local one but not the global one. You are clearly accessing the global one in Me.UserChartControl11.Plot1. You may need to trace through that program and determine why the value is ending up as null.

Please post back if you find the problem on your own.

Go to Top of Page

quinncurtis

1164 Posts

Posted - 11 Sep 2003 :  15:23:43  Show Profile  Reply with Quote
Turned out to be a bug in the DLL after all. Sorry to attribute it to a programming error. That is the last time I will be 99.9% certain about something.

Registered owners of the software can download updated version using their orignal download links.
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