Specifies properties of an axis. It is an object literal in which all properties are optional.

Since

2013.0

Hierarchy

  • AxisConfiguration

Properties

axisLineStyle?: LineStyle

The line style of the axis.

gridLine?: boolean

Indicates whether a measuring tick should be extended as a grid line over the map. The default is false.

labelFormatter?: ((value) => string)

Type declaration

    • (value): string
    • A formatter function. It must map a single numerical value to a string.

      var axisConfiguration = {
      labelFormatter: function(n){
      return n.toString();
      }
      };

      Parameters

      • value: number

      Returns string

labelRotation?: number

The rotation of the label in degrees. The rotation point is the anchor point of the label. You can specify the anchor point of the label using the labelStyle property of this configuration object. Describe the horizontal component of the anchor point with the textAnchor property and the vertical component with the alignmentBaseline property. The rotation is clockwise.

labelStyle?: TextStyle

The style of the labels. A label will be drawn at each measuring tick. The default anchor point of the label is in the middle for the X-axis (alignmentBaseline='top' and textAnchor='center'), and at the end for the Y-axis (alignmentBaseline='middle' and textAnchor='end').

spacing?: {
    mapSpacing: number[];
    minimumTickSpacing: number;
}

A configuration object indicating how ticks should be spaced alongside the axis. It is an object literal consisting of 2 properties.

  • {Number} minimumTickSpacing: the minimum amount of pixels that should be present between two measuring ticks. Note that this is an approximate. The actual amount of pixels between two measuring ticks may vary according to the current scale of the map and to the mapSpacing parameter
  • {Array} mapSpacing: an array of allowed distances, expressed in the unit of measure of the axis. Depending on the value of minimumTickSpacing the most appropriate value will be selected.

//the ticks will be spaced at least 200 pixels apart on the screen.
//The spacing in map coordinates will be one of the allowed values in the array.
//Note that both values specify only approximately how far measuring ticks will be apart.
//If no match can be made that satisfies both constraints, the closest map spacing possible will be used.

var axisConfiguration = {
spacing: {
minimumTickSpacing: 200,
mapSpacing: [1,5,10,50,100,500,1000,5000,10000,50000,100000,500000,1000000,5000000,10000000]
}
};

Type declaration

  • mapSpacing: number[]
  • minimumTickSpacing: number
subTickLength?: number

The size of the sub ticks.

subTicks?: number

The number of smaller ticks in between the main measuring ticks. These are not labeled.

tickLength?: number

The size of the measuring tick drawn on the axis

tickLineStyle?: LineStyle

The line style of the axis ticks (at each measuring tick). This line style will also be applied to the grid lines, which can be turned on by configuring the gridLine property.