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#)
 How to set a reference to a Chart Object
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pachart

15 Posts

Posted - 08 Dec 2003 :  10:06:19  Show Profile  Reply with Quote
If I define a ChartView, and add some objects such as XAxies, and YAxis, Title, and Footer to the chart by method AddChartObject. Then I want to set a reference to the objects. How to do it?

For example, after drawing the chart. I want to get the color setting of the YAxis. How to write the code?

quinncurtis

1164 Posts

Posted - 08 Dec 2003 :  10:49:08  Show Profile  Reply with Quote
This is just a basic c# programming question, is it not, and not really related to the charting software? You would have the same basic problem if you were to create an instance of any object of any c# class inside a method.

When you create an object, such as an axis object, you can save a reference to that object as a global class variable, rather than as a variable local to the method that defines the initial graph. You can then access that object using the class reference.

The same basic techique is used regardless if you are using c# or VB, since aside from minor syntactical differences, they are the same language.

public class YourChart : com.quinncurtis.chart2dnet.ChartView
{

public LinearAxis xaxis = null;

public YourChart()
{

xaxis = new LinearAxis(,,);

}
}

You would access the axis object
using your instance of the YourChart object.

YourChart thechart;

// somewhere the YourChart class gets instantiated.

// Get the color of the axis
Color axiscolor = thechart.xaxis.GetColor();

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