addTarget(target,label[,linestyle,color,measure])

Draws a target line in the plot area using the specified color and line style. The target line extends from the left side of the plot area to the right side.

Parameter

target Numerical value at which to draw the line

label The text (String) placed next to the line

linestyle The line style (a Line Styles constant)

color The line color (see value.color for values)

measure Name of measure on which to draw target line

Example (Viewsheet)

Follow the steps below:

1. Create a new Viewsheet based on the 'Sales' > 'Sales Explore' Data Worksheet.

2. Drag a new Chart into the Viewsheet grid. Press the 'Edit' button on the Chart to open the Chart Editor.

3. From the Data Source panel, drag the 'State' field to the 'X' binding region of the Data panel.

4. From the Data Source panel, drag the 'Total' and 'Quantity Purchased' fields to the 'Y' binding region of the Data panel.

5. (Optional) Drag the legend to the bottom of the Chart.

6. Right-click on the Chart, and select 'Properties' from the context menu. This opens the 'Chart Properties' dialog box.

7. Open the Script tab, and add the following code:

addTarget(average(data["Sum(Total)"]), "Average Sales", Chart.THICK_LINE, [255,0,0],"Sum(Total)");

8. Press 'OK' to close the 'Chart Properties' dialog box.

This renders a target line for the “Sum(Total)” measure at the average value of the data in the 'Total' field.

 

<< value.visible © 1996-2013 InetSoft Technology Corporation (v11.4) applyEffect >>