AxisSpec.setLabelOnSecondaryAxis(Boolean)

Specifies whether axis labels are displayed on the opposite side of the chart. For a Y-axis, labels move from left to right; for an X-axis, labels move from bottom to top. Note: There is no corresponding “getter” function.

Parameter

Boolean

true: display labels on the opposite side
false: display labels on the default side (default)

Example

Chart Component Script
var spec = new AxisSpec();
spec.setLabelOnSecondaryAxis(true); (1)
1 Move axis labels to the opposite side of the chart.
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.getYScale() ②, 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.getYScale();
var spec = scale.getAxisSpec();
spec.setLabelOnSecondaryAxis(true);