Author |
Topic  |
|
pachart
15 Posts |
Posted - 08 Dec 2003 : 10:06:19
|
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
|
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();
|
 |
|
|
Topic  |
|
|
|