A color axis is similar to an x or y axis. However, instead of mapping data values to positions, a color axis maps data values to colors. Color axes are used in ContourLayer and in SurfaceChart objects.
Similar to an x or y axis, a color axis is visually represented as a thin bar that can be horizontal or vertical, and has a scale along its length. The scale can be set explicitly or can be determined by auto-scaling.
Note: If you are using the color axis on a surface chart, please note that by default, the color axis scale is synchronized to the z axis. You need to use Axis.syncAxis to cancel the synchronization before you can independently set the color axis scale.
In addition to the scale, a color axis is colored with a continuous color gradient or discrete color steps along its length. This maps the values on the axis with colors.
For an x or y axis, the major and minor ticks correspond to major and minor grid lines on the chart. For a color axis, these ticks correspond to major and minor contour lines on the chart.
Like an x or y axis, you can add marks to the color axis using Axis.addMark. They will become mark contour lines on the chart.
The color axis, if visible, acts as a color legend. The axis stem is a thin rectangle 15 pixels in width, configurable with Axis.setWidth. A bounding box can be added to surround the color axis using ColorAxis.setBoundingBox.
A color axis works normally (determines color mapping and contour levels) even if it is not displayed.
| Method | Inherited | Description |
|---|---|---|
| setAxisPos | (Self) | Sets the position of the color axis. |
| setColorGradient | (Self) | Sets the continuous color gradient or discrete color steps for the color axis. |
| setColorScale | (Self) | Sets the axis scale and the associated colors. |
| setLevels | (Self) | Sets the maximum number of contour intervals on the axis. |
| setCompactAxis | (Self) | Sets whether to compact the axis or not. |
| setAxisBorder | (Self) | Sets the border color and 3D border effect of the axis stem. |
| setBoundingBox | (Self) | Sets the background color, border color and 3D border effect of the bounding box. |
| setBoxMargin | (Self) | Sets all margins (left, right, top, and bottom) of the bounding box to the same value. |
| setBoxMargin2 | (Self) | Sets the margins of the bounding box in pixels. |
| setRoundedCorners | (Self) | Sets the border style of the bounding box to rounded corners. |
| getBoxWidth | (Self) | Gets the width of the color axis inclusive of the bounding box. |
| getBoxHeight | (Self) | Gets the height of the color axis inclusive of the bounding box. |
| getColor | (Self) | Gets the color given the data value. |
| setLabelStyle | Axis | Sets the font style used to for the axis labels. |
| setLabelFormat | Axis | Sets the format for numeric or date/time axis labels. |
| setMultiFormat | Axis | Sets multiple formats for numeric or date/time axis labels. |
| setMultiFormat2 | Axis | Adds one filter and format string to the multi-format lists. |
| setFormatCondition | Axis | Specifies the condition that subsequent Axis.setLabelFormat and Axis.setMultiFormat will become applicable. |
| setLabelAlignment | Axis | Sets the alignment of the axis labels relative to their associated ticks. |
| setLabelGap | Axis | Sets the distance between the axis labels and the ticks on the axis. |
| setLabelOffset | Axis | Shifts the axis labels from its default position along the axis. |
| setTitle | Axis | Adds a title to the axis. |
| setTitlePos | Axis | Sets the position of the axis title relative to the axis. |
| setColors | Axis | Sets the colors of the axis itself, axis label, axis title and axis ticks. |
| setTickLength | Axis | Sets the length of the axis ticks. |
| setTickLength2 | Axis | Sets the length of the major and minor axis ticks. |
| setTickWidth | Axis | Sets the width of the axis ticks. |
| setTickColor | Axis | Sets the colors of the axis ticks. |
| setTickOffset | Axis | Shifts the position of the ticks along the axis. |
| setMinTickInc | Axis | Sets the minimum distance between two ticks on the axis for auto-scaled axis. |
| setWidth | Axis | Sets the line width of the axis. |
| setLength | Axis | Sets the length of the axis. |
| setMargin | Axis | Reserve margins at the ends of the axis. |
| setIndent | Axis | Specifies if the axis should be "indented" or not. |
| setOffset | Axis | Sets the positional offset of the axis. |
| setAutoScale | Axis | Sets the margins at the two ends of the axis during auto-scaling, and whether to start the axis from zero. |
| setRounding | Axis | Controls whether to round the ends of the axis to align with tick positions. |
| setTickDensity | Axis | Sets the density of the axis ticks. |
| setReverse | Axis | Reverse the axis. |
| setLabels | Axis | Sets the text labels to be used on the axis. |
| setLabels2 | Axis | Sets the numeric/date/time labels to be used on the axis. |
| setLabelStep | Axis | Shows a regularly spaced subset of the axis labels on the axis. |
| setLinearScale | Axis | Sets the axis to use the given linear scale. |
| setLinearScale2 | Axis | Sets the axis to use the given linear scale and the given labels. |
| setLinearScale3 | Axis | Sets the axis to use linear auto-scale. |
| setLogScale | Axis | Sets the axis to use the given logarithmic scale. |
| setLogScale2 | Axis | Sets the axis to use the given logarithmic scale and the given labels. |
| setLogScale3 | Axis | Sets the axis to use logarithmic auto-scale. |
| setDateScale | Axis | Sets the axis to use the given date scale. |
| setDateScale2 | Axis | Sets the axis to use the given date scale and the given labels. |
| setDateScale3 | Axis | Sets the axis to use date auto-scale. |
| syncAxis | Axis | Synchronizes this axis with another axis using a linear formula. |
| copyAxis | Axis | Copies the scale and labels from another axis. |
| addLabel | Axis | Adds an extra label on the axis. |
| addMark | Axis | Adds a mark line to the chart. |
| addZone | Axis | Adds a zone to the chart. |
| makeLabelTable | Axis | Creates a CDML table and docks it to the axis, with one row (for horizontal axis) or column (for vertical axis) containing the axis labels. |
| getLabelTable | Axis | Gets the CDML table created by Axis.makeLabelTable. |
| getMinValue | Axis | Gets the lower bound of the axis. |
| getMaxValue | Axis | Gets the upper bound of the axis. |
| getX | Axis | Gets the x-coordinate of starting point of the axis. |
| getY | Axis | Gets the y-coordinate of starting point of the axis. |
| getAlignment | Axis | Gets the side of the plot area that the axis is associated with. |
| getThickness | Axis | Gets the thickness of the axis. |
| getTicks | Axis | Gets the values of the ticks. |
| getLabel | Axis | Gets the label at the specified position on the axis. |
| getFormattedLabel | Axis | Gets the label at the specified position on the axis, formatting one if necessary. |
| getHTMLImageMap | Axis | Generates an HTML image map for the axis labels. |
| getAxisImageMap | Axis | Generates an HTML image map for the axis itself. |