| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (7 out of 14)

Configuring Value Axes

The Value-axes attribute of a trend chart determines how the vertical axes of a chart appear and behave. The value axes of a trend chart are:


You can access value axes from:

The attribute tables of the value axis defaults and the value axis subtable are:


Displaying the Value Axis

The Value-axis-visible? attribute determines whether the value axis is displayed on the trend chart. This attribute is not on the value axis defaults subtable.

Regardless of whether a value axis is visible, all of its functionality, such as its range-mode and range-bounds, is still in effect.

Specifying the Value Range

The Range-mode attribute specifies how G2 adjusts the value axis in response to plotting values outside of the current range of this value axis. The range of the value axis increases by the amount specified in the Range-slack-percentage attribute.

This attribute has three modes:

The term autoranging indicates that G2 controls the range of values for this value axis according to the criteria you specify as:

When Range-mode is... Then G2...
autoranging on data window
Adjusts the value axis bounds to the minimum and maximum values of all data plotted in the data window.
autoranging on all past values
Adjusts the value axis bounds to include the minimum and maximum values, not only of the data plotted on the data window, but of all values in the trend chart history since G2 started.
fixed
Includes only those values specified in the next attribute, Range-bounds. G2 does not plot points outside of this range. For example, if you want the range to be from 0 - 100, set the Range-mode attribute to fixed, and specify the Range-bounds attribute as 0 to 100.

Specifying fixed in this attribute and not setting the Range-bounds attribute accordingly causes G2 to use the attribute default, autoranging on data window.

All values that the trend chart displays will be truncated to lie within the range of ± 1.7978e304, even when the value axis is autoranging.

Specifying Range Limits

The Range-bounds attribute specifies the numerical bounds for a value axis as a from-to value, for instance 0 to 100. These bounds are used in conjunction with the Range-mode attribute as follows.

If Range-mode is fixed, the trend chart uses the Range-bounds exactly as you specify them.

If Range-mode is set to either of the autoranging modes, G2 uses the Range-bounds that you specify as a starting point for the value axis bounds. If the minimum or maximum plot data values exceed the specified Range-bounds, the bounds are adjusted automatically to accommodate the values.


Note: The value bounds cannot exceed ± 1.7978e304, and will be truncated to this limit.

Defining the Range Slack Percentage

The Range-slack-percentage attribute defines the percentage G2 increases the Range-mode value of the value axis in response to plotting a point that is not currently in range. This attribute is applicable only when the Range-mode attribute is set to either of the autoranging modes, described in Specifying the Value Range.

Specifying the Label Frequency

The Label-frequency attribute specifies the number of labels that are displayed on the value axis and where those labels will appear.

Choosing automatic directs G2 to provide an appropriate number of value labels based on the space available on the trend chart. G2 automatically computes which values to label, based on the plot values.

You can also specify a set number of value labels (such as 10 labels), or a label at specific intervals (every 10), optionally starting at a particular number (every 10 beginning at 20). If no beginning is specified, 0 is assumed.

When the Grid-lines-visible? attribute for the value axis is set to yes, each label is aligned on the grid line. If the value range is very large, it is possible for there to be too many grid lines to accommodate labels.

For instance, if you specify the Label-frequency as every 10 and the Range-bounds are from 0 to 10,000, the range exceeds the number of labels that can be displayed legibly.

In such a case, G2 would change the label frequency that you had requested and display an appropriate message in the trend chart Notes attribute, as shown in this diagram.


Displaying Labels as Percentages

The Show-labels-as-percent? attribute changes the value axis labels to show the values as a percentage of the entire range of the value axis range.

Specifying the Significant Digits for Labels

The Significant-digits-for-labels attribute specifies the number of significant digits. The default 4 accommodates numbers up to 99.99 and numbers down to, and including, 0.01.

If the label value is outside of the range that can be accommodated, G2 displays the label as an exponential expression, 1.0e2 for 100 when 4 is the value for this attribute.

Showing Grid Lines

The Grid-lines-visible? attribute determines whether grid lines are displayed for the value axis.


In most cases, for the sake of clarity, we recommend that only one value axis has a set of visible gridlines. For instance, in a trend chart that has two value axes, each representing different plot values, especially when the range-mode is set to autoranging on data window, two grid lines can make the trend chart difficult to read. The diagram here illustrates a portion of the sample trend chart used throughout this chapter with Grid-lines-visible? set to yes for two value axes.

Adding Extra Grid Lines

The Extra-grid-lines attribute specifies:

For example, to add extra grid lines at several different positions in a particular color specify:

If you do not specify a color for the extra grid lines, G2 uses the current grid line color. Note that you can see extra grid lines even if the Grid-lines-visible? attribute is set to no.

Displaying a Baseline

The Baseline-visible? attribute determines whether the baseline for the value axis is displayed. Set the attribute to yes to display the baseline, which is a vertical line that displays to the left or the right of the value axis, depending on which side of the trend chart the axis is displaying.

Specifying the Baseline Color

The Baseline-color attribute determines the color of the value axis baseline. The value axis baseline must be set to yes for this attribute to have any effect.

Summarizing Value Axis Attributes

The value axis attributes are:

Attribute Description
Names
The optional value axis name. This attribute is not on the defaults subtable. You can refer to a value axis either by name (if you provide one) or by reference number in the trend chart attribute table or on the plots table.
Allowable values:
Any symbol
Default value:
none


Value-axis-visible?
Determines whether the value axis is displayed on the trend chart. This attribute is not on the value axes defaults subtable. Regardless of whether a value axis is visible, the value axis functionality, such as its range-mode and range-bounds, are still in effect.
Allowable values:
{yes | no}
Default value:
yes


Value-axis-position
Determines on which side of the trend chart the value axis is displayed. Changing the side moves both the value axis base line and any labels.
Allowable values:
{left | right}
Default value:
right


Range-mode
Determines how G2 adjusts the value axis in response to plotting values outside of the current range of this value axis.
Allowable values:
{fixed | autoranging on all past values |
autoranging on data window}

Default value:
autoranging on data window


Range-bounds
Specifies the numerical bounds for a value axis.
Allowable values:
{none | from integer to integer}
Default value:
none


Range-slack-percentage
The amount G2 increases the range mode value of the value axis in response to plotting a point that is not currently in range.
Allowable values:
{none | 1 - 100}
Default value:
10


Labels-visible?
Determines whether the value labels are visible.
Allowable values:
{yes | no}
Default value:
yes


Label-color
Determines the color of the labels for this value axis.
Allowable values:
{color-name | match plot color}
Default value:
black


Label-frequency
Determines the number of labels that are displayed and where those labels appear on the value axis.
Allowable values:
{automatic | integer labels {every integer |
every integer beginning at integer} }

Default value:
automatic


Show-labels-as-percent?
Changes the labels to show values as a percentage of the value axis range.
Allowable values:
{yes | no}
Default value:
no


Significant-digits-for-labels
Determines the number of significant digits. The default 4 accommodates numbers up to 99.99 and numbers down to, and including, 0.01.
Allowable values:
{integer}
Default value:
4


Grid-lines-visible?
Determines whether grid lines for the value axis are visible.
Allowable values:
{yes | no}
Default value:
yes


Grid-line-color
Determines the color of the grid lines for this value axis.
Allowable values:
{color-name}
Default value:
gray


Grid-lines-per-label
Lets you determine how many grid lines appear for each value axis label you are formatting.
Allowable values:
{1 - 50}
Default value:
1


Extra-grid-lines
Determines the position and color of extra grid lines.
Allowable values:
{none | at number [, ...] [in color-name] }
Default value:
none


Baseline-visible?
Determines whether the baseline for the value axis is visible.
Allowable values:
{yes | no}
Default value:
yes


Baseline-color
Determines the color of the value axis base line.
Allowable values:
{color-name}
Default value:
black

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (7 out of 14)

Copyright © 1997 Gensym Corporation, Inc.