AxisSpec.setLastOrAll(Boolean)

Specifies the truncation behavior for multi-line axis labels when there is insufficient space to display all lines. When true, only the last line is kept; when false, as many lines as can fit are kept. Note: There is no corresponding “getter” function.

Parameter

Boolean

true: keep only the last line of a truncated multi-line label
false: keep as many lines as can fit

Example

Chart Component Script
var spec = new AxisSpec();
spec.setTruncate(true);
spec.setLastOrAll(true); (1)
1 When truncating multi-line labels, keep only the last line.
Script that modifies the graph or dataset properties should be placed on the Chart component itself. See Add Component Script for more information. This script has access to the Chart data and Chart API methods. Scripted Charts are not good candidates for user-modification, so you should deselect ‘Enable Ad Hoc Editing’ in the Chart Properties dialog box.

To change the property on a Chart that was previously created with the Chart Editor, use EGraph.getCoordinate() ①, RectCoord.getXScale() ②, and Scale.getAxisSpec() ③ to obtain a handle to the desired Coordinate object, Scale object, and so on. For example:

var coord = Chart1.getCoordinate();
var scale = coord.getXScale();
var spec = scale.getAxisSpec();
spec.setLastOrAll(true);