Representing Data With Text
To display a dimension or measure values using text, drag the dimension or measure from the Data Source panel to the 'Text' field in the Visual panel.

Note: By default, dimension and measure values are automatically displayed by tooltip when the Viewsheet is previewed or deployed.
To format the text displayed for the dimension or measure, follow the steps below:
1. Click the 'Edit' button next to the 'Text' field.

This opens the 'Text Format' dialog box.

2. Select the text size, font, and color.
3. Select the format for the displayed text. See Format Tab for an explanation of the format options.
4. Press 'OK' to close the dialog box.
Alternatively, you can click the text on the chart to select it, and then press the desired toolbar buttons to change the formatting.
See Also
Adding Formats to Dimensions, for information on using format to categorize.
Adding Formats to Measures, for information on using format to code data.
Adding a Sub-Series, for information on using format to create groupings.
When you display a measure on a chart as text, the text is placed next to the corresponding data points. For example, in the chart below (based on the 'Order Model' data model), the bars represent the 'Total' values, and the 'Text' binding displays the 'Quantity Purchased' values as text next to the bars.

In some cases, it may be desirable to display the 'Quantity Purchased' value superimposed on top of the bars:

To do this, you can introduce a dummy measure to act as an anchor for the text. Follow the steps below to create this example:
1. Create a new Viewsheet base on the 'Order Model' data model, and drag a Chart component from the Components panel into the Viewsheet grid.
2. From the Data Source panel, drag the 'State' field from the 'Customer' entity to the 'Y' region of the Data panel.
3. From the Data Source panel, drag the 'Total' field from the 'Product' entity to the 'X' region of the Data panel.
4. In the Data Source panel, right-click on the 'Product' entity, and select 'New Calculated Field'.

5. Name the field 'TextAnchor' and select the 'Detail' option. Press 'OK'. This opens the Formula Editor.

6. In the Formula Editor, set the 'Return Data Type' to 'Double', enter the formula “1”, and press 'OK'.
This creates a new measure that has the uniform value “1”. You will use this measure to anchor the 'Quantity Purchased' values to the left side of the plot region.
7. Drag the new 'TextAnchor' measure from the Data Source panel to the 'X' region of the Data panel, under the 'Total' field.

8. Press the 'Select Chart Style' button, and enable the 'Multiple Styles' option. Press the green 'Apply' button to close the panel.

9. Press the 'Select Chart Style' button next to the 'Total' field, and switch the chart style to 'Bar'.
10. Press the 'Select Chart Style' button next to the 'TextAnchor' field, and switch the chart style to 'Point'.
11. Press the 'Switch to Single Graph' button to place both data sets on the same axis.

12. Right-click on the legend, and select 'Hide Legend'.
13. In the Visual panel, click the title bar between the arrows and select the 'Sum(TextAnchor)' measure.

14. From the Data Source panel, Drag the 'Quantity Purchased' field from the 'Product' entity to the 'Text' region of the Visual panel.

15. In the Visual panel, press the 'Edit' button in the 'Shape' region, and press the 'Clear' button. This hides the points for the 'TextAnchor' measure.

16. In the Visual panel, press the 'Edit' button in the 'Color' region, and set a black color for the text.
17. Right-click on the chart and select 'Properties'. This opens the 'Chart Properties' dialog box.
18. Select the Script tab, and enter the following script, and press 'OK'.
graph.getElement(1).setLabelPlacement(GraphConstants.RIGHT)

This sets the alignment appropriately, and yields the desired result:

| << Representing Data with Size | © 1996-2013 InetSoft Technology Corporation (v11.5) | 4.4.10 Adding Highlights to a Chart >> |