Implicitly Created Nodes

Some chart nodes automatically create additional nodes, as their children, when they are created. These nodes can be accessed by Get methods or properties. For example, the code

chart.Background.FillColor = System.Drawing.Color.Green;

changes the background color.

The Background property retrieves the Background node from the chart object and the FillColor property sets the Background objectís FillColor attribute to Color.Green.

In the following diagram, the nodes automatically created are shown in light green (to view in color see the online documentation).

intro004

Method calls and property references can be chained together. For example, the following sets the thickness of the major tick marks on the x-axis:

axis.AxisX.MajorTick.LineWidth = 2.0;

where axis is an AxisXY object.

A customized version of the above chart can be obtained by changing its constructor as in the following:

intro002.png

 

(Download Code)

 

using Imsl.Chart2D;

 

public class Intro2 : FrameChart {

 

    public Intro2() {

        Chart chart = this.Chart;

        AxisXY axis = new AxisXY(chart);

        double[] y = new double[] {4, 2, 3, 9};

        new Data(axis, y);

        chart.Background.FillColor = System.Drawing.Color.Lime;

        axis.AxisX.MajorTick.LineWidth = 2.0;

    }

 

    public static void Main(string[] argv) {

        System.Windows.Forms.Application.Run(new Intro2());

    }

}

 



Visual Numerics - Developers of IMSL and PV-WAVE
http://www.vni.com/
PHONE: 713.784.3131
FAX:713.781.9260