Representing Data With Text

To display dimension or measure values using text, drag the desired field from the Data Source panel to the 'Text' region in the Binding panel.

Note: By default, dimension and mea­sure values are auto­matically displayed by tooltip when the report is 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 Formatting for an explanation of the format options.

4. Click 'OK' to finalize the settings.

Example: : Superimposing Measure Values Over a Bar Chart  >>

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 (in the Visual panel) 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 report and add a Chart component from the Toolbox panel into the report.

2. Click on the Chart to select it. In the Data Source panel, expand the 'Orders' data source and expand the 'Order Model'.

3. From the Data Source panel, drag the 'State' field from the 'Customer' entity to the 'Y' region of the Data panel.

4. From the Data Source panel, drag the 'Total' field from the 'Product' entity to the 'X' region of the Data panel.

5. In the Data Source panel, right-click on the 'Order Model', and select 'Create Calculated Field'.

 

This opens the 'Formula' dialog box.

6. Name the field 'TextAnchor' and set the 'Return Data Type' to 'Double'. Press the 'Edit' button to open the Script Editor.

 

7. In the Script Editor, enter the formula “1”, and press 'Save and Close'. Press 'OK' in the 'Formula' dialog box.

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.

8. Drag the new 'TextAnchor' measure from the Data Source panel to the 'X' region of the Data panel, under the 'Total' field.

 

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

 

10. Press the 'Select Chart Style' button next to the 'Total' field, and switch the chart style to 'Bar'.

11. Press the 'Select Chart Style' button next to the 'TextAnchor' field, and switch the chart style to 'Point'.

12. Press the 'Switch to Single Graph' button to place both data sets on the same axis.

 

13. In the Properties tab of the Report Element panel, set 'LegendPosition' to '(none)'.

 

14. In the Visual panel, click the title bar between the arrows and select the 'Sum(TextAnchor)' measure.

 

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

 

16. 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.

 

17. In the Visual panel, press the 'Edit' button in the 'Color' region, and set a black color for the text.

18. Right-click on the chart and select 'Script'. Enter the following script in the Editor, and press 'Save and Close'.

graph.getElement(1).setLabelPlacement(GraphConstants.RIGHT)

 

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

 

 

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.

<< Representing Data With Size © 1996-2013 InetSoft Technology Corporation (v11.5) 6.6.4 Setting the Chart Style >>