AddScaleMarker

Syntax graph.AddScaleMarker(scale, type, low/width, high/position, color)

Description Places a line over or highlighted range behind the graph at the specified scale index on the graph. This is helpful when you want to emphasize data items that are above or below a certain level, or emphasize data items that are in a certain range.

There are two types of scale markers: range and line. The line scale marker draws a line over the graph at a certain scale index, while the range scale marker highlights the area between two scale indices (highlighting will appear behind the graph).

Example 5.10 illustrates the difference between line and range scale markers. The first two commands create the green and red areas behind the graph. These are range scale markers. The last command creates a line scale marker, which is the red line that appears in front of the graph.

Pie graphs and Gauges are the only graphs that do not have scale markers.

Parameters Graph.AddScaleMarker uses the following parameters.

scale

{ x | y | value | svalue | time }

The scale that you want to put the value on. For most graphs, you will want to set this to value (value scale). For Line Bar Combo graphs, you can also choose svalue (secondary value scale—i.e. the scale on the right side of the graph). For Time Graphs, you can also choose the time scale (along the bottom). For X-Y and Time graphs, you should use either x (x-axis) or y (y-axis).

type

{ range | line }

Sets the type of the scale markers—line or range.

low/width

int

For line scale markers, this parameter sets the width of the line.

For range scale markers, this sets the value along the specified scale at which to begin highlighting.

high/position

int

For line scale markers, this value is the position of the line along the scale specified with the scale parameter.

For range scale markers, this represents the value along the specified scale at which to end highlighting. This value must be higher than the value passed to the low/width parameter.

color

Color

The color of the graph, using the standard six-digit hexadecimal representation (RRGGBB). There should not be a pound # sign before the color code.