ChartDirector 7.0 (Perl Edition)

ColorAxis


The ColorAxis class represents color axes. It is a subclass of Axis.

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 DiscreteHeatMapLayer and ThreeDChart 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: On a ThreeDChart, by default, the color axis scale is synchronized to the z axis. You can use Axis.syncAxis to disable the synchronization so that you can independently set the color axis scale. On a SurfaceChart, the synchronization will also be disabled if you provide w data values.

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.

MethodInheritedDescription
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.
getColorScale(Self)Gets the color stops defining 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.
setLabelStyleAxisSets the font style used to for the axis labels.
setLabelFormatAxisSets the format for numeric or date/time axis labels.
setMultiFormatAxisSets multiple formats for numeric or date/time axis labels.
setMultiFormat2AxisAdds one filter and format string to the multi-format lists.
setFormatConditionAxisSpecifies the condition that subsequent Axis.setLabelFormat and Axis.setMultiFormat will become applicable.
setLabelAlignmentAxisSets the alignment of the axis labels relative to their associated ticks.
setLabelGapAxisSets the distance between the axis labels and the ticks on the axis.
setLabelOffsetAxisShifts the axis labels from its default position along the axis.
setTitleAxisAdds a title to the axis.
setTitlePosAxisSets the position of the axis title relative to the axis.
setColorsAxisSets the colors of the axis itself, axis label, axis title and axis ticks.
setTickLengthAxisSets the length of the axis ticks.
setTickLength2AxisSets the length of the major and minor axis ticks.
setTickWidthAxisSets the width of the axis ticks.
setTickColorAxisSets the colors of the axis ticks.
setTickOffsetAxisShifts the position of the ticks along the axis.
setMinTickIncAxisSets the minimum distance between two ticks on the axis for auto-scaled axis.
setWidthAxisSets the line width of the axis.
setLengthAxisSets the length of the axis.
setMarginAxisReserve margins at the ends of the axis.
setIndentAxisSpecifies if the axis should be "indented" or not.
setOffsetAxisSets the positional offset of the axis.
setAutoScaleAxisSets the margins at the two ends of the axis during auto-scaling, and whether to start the axis from zero.
setRoundingAxisControls whether to round the ends of the axis to align with tick positions.
setTickDensityAxisSets the density of the axis ticks.
setReverseAxisReverse the axis.
setLabelsAxisSets the text labels to be used on the axis.
setLabels2AxisSets the numeric/date/time labels to be used on the axis.
setLabelStepAxisShows a regularly spaced subset of the axis labels on the axis.
setLinearScaleAxisSets the axis to use the given linear scale.
setLinearScale2AxisSets the axis to use the given linear scale and the given labels.
setLinearScale3AxisSets the axis to use linear auto-scale.
setLogScaleAxisSets the axis to use the given logarithmic scale.
setLogScale2AxisSets the axis to use the given logarithmic scale and the given labels.
setLogScale3AxisSets the axis to use logarithmic auto-scale.
setDateScaleAxisSets the axis to use the given date scale.
setDateScale2AxisSets the axis to use the given date scale and the given labels.
setDateScale3AxisSets the axis to use date auto-scale.
syncAxisAxisSynchronizes and align this axis with another axis using a linear formula.
copyAxisAxisCopies the scale and labels from another axis.
syncScaleAxisSynchronizes the scale of this axis with another axis using a linear formula.
addLabelAxisAdds an extra label on the axis.
addMarkAxisAdds a mark line to the chart.
addZoneAxisAdds a zone to the chart.
makeLabelTableAxisCreates a CDML table and docks it to the axis, with one row (for horizontal axis) or column (for vertical axis) containing the axis labels.
getLabelTableAxisGets the CDML table created by Axis.makeLabelTable.
getMinValueAxisGets the lower bound of the axis.
getMaxValueAxisGets the upper bound of the axis.
getXAxisGets the x-coordinate of starting point of the axis.
getYAxisGets the y-coordinate of starting point of the axis.
getAlignmentAxisGets the side of the plot area that the axis is associated with.
getThicknessAxisGets the thickness of the axis.
getTicksAxisGets the values of the ticks.
getLabelAxisGets the label at the specified position on the axis.
getFormattedLabelAxisGets the label at the specified position on the axis, formatting one if necessary.
getHTMLImageMapAxisGenerates an HTML image map for the axis labels.
getAxisImageMapAxisGenerates an HTML image map for the axis itself.