addStandardDeviationTarget(measure, colors, values, options)

Draws a set of horizontal or vertical lines on the chart to mark the specified number of standard deviations from the mean. See Add a Target Line/Curve Fit for more information about target lines.

Individual target lines are accessed in script as GraphForm objects. To remove a specific target line, use graph.removeForm(index). Indexing for all GraphForm objects begins at 0 and proceeds in the order that objects were added to the chart. To remove all target lines, use clearTargets().

Parameter

measure

Name of measure on which to draw standard deviation lines

colors

Color (see valueColor) or array of colors to fill areas between standard deviation lines

values

Array of multipliers for which to draw standard deviation lines

options

Name-value pairs of options (see Options below, e.g., {fillAbove:0xff0000, fillBelow:0x00ff00})

Options

fillAbove

Color (see valueColor) to fill the region above the upper standard deviation line

fillBelow

Color (see valueColor) to fill the region below the lower standard deviation line

label

String, or array of strings, to label the standard deviation line(s). The following codes can be inserted:

{0}: Target value
{1}: Target formula
{2}: Field name

The code can be followed by a format type and format string, for example, {0,number,$#,##0}. See Add Data Format for more information about formatting.

lineColor

Color (see valueColor) to apply to all standard deviation lines

lineStyle

The line style (a Line Style constant) to apply to all standard deviation lines

labelFont

The font description (e.g., 'Lucida Sans Unicode-BOLD-14') to apply to all line labels

labelColor

The color (see valueColor) to apply to all line labels

Example

// The 'options' object is broken into several lines for clarity:
var options = {fillAbove:[225,225,225],fillBelow:[225,225,225], \
label:['{1}: {0,number,$#,##0}','{1}: {0,number,$#,##0}','{1}: {0,number,$#,##0}','{1}: {0,number,$#,##0}'], \
lineColor:'red',lineStyle:Chart.THICK_LINE,labelFont:'Lucida Sans Unicode-BOLD-11',labelColor:'black'};
Chart1.addStandardDeviationTarget('Sum(Product:Total)',[0xDDCCCC,0xDDAAAA,0xDDCCCC],[-1,1,-2,2],options)

PlotAddTargetStDev1

Either syntax below can be used in component script:

addStandardDeviationTarget         // unqualified
Chart1.addStandardDeviationTarget  // qualified

For onInit/onRefresh scripts, and for component and property scripts on other components, the second (qualified) form is required.