IMSL C# Programmer’s Guide
2D Drawing Elements >> AxisXY >> Axis Label  Previous Page  Contents  Next Page

Axis Label

The AxisLabel node controls the labeling of an axis. The drawing of this node is controlled by the Text Attributes.

Scientific Notation

If the values along an axis are large, scientific notation is more readable than a decimal format with many zeros. In this example the y-axis is labeled with scientific notation where each number has exactly two fractional digits displayed. This format pattern is "0.00E0". See Formatting Types in the .Net Framework Developer’s Guide for details on number formatting patterns.

Date Labels

If the TextFormat attribute for an axis is set to a date format, then the axis is scaled and labeled as a date/time axis instead of as a real axis.

Date information passed to the Data constructor must be a double or long, usually obtained from the Ticks property of a DateTime instance.

Skipping Weekends

An additional feature of Date axes is the ability to skip weekends. This feature is often needed for charting stock price data.

To skip weekends it is necessary to adjust the autoscaling for weekdays-only. This is done by setting the attribute TransformDate to true. It is also necessary to set a custom transformation, TransformDate, on the axis. This is shown in the following example, which is a modification of the example in the previous section.

Skipping weekends is intended only for data sets where no weekend data exists. It will not give the expected results if the data set contains weekend data.

String Labels

Any array of strings can be used to label the tick marks using the SetLabels(string[]) method. The SetLabels(string[]) method sets the Number attribute to the number of strings.



©  Visual Numerics, Inc.  All rights reserved.  Previous Page  Contents  Next Page