Class pvc.options.axes.ColorAxis
Constructor Attributes | Constructor Name and Description |
---|---|
<abstract> |
The options documentation class of the color axis.
|
Field Attributes | Field Name and Description |
---|---|
Scale | |
The colors of a color axis.
|
|
The color to use when an optional color role is unbound.
|
Method Attributes | Method Name and Description |
---|---|
Scale | |
transform(color)
The color transform function.
|
A color axis panel and its properties can be referred to in several ways, using one of the following prefixes, in order of precedence:
- By full id
- the id of the axis is the word color, followed by it's index (when >= 2), and terminated by the word Axis.
- (e.g.: colorAxis, color2Axis, color3Axis, ...)
- By scale type
- the scale type can be discreteColorAxis or continuousColorAxis and, in the latter case, with higher precedence, numericColorAxis and timeSeriesColorAxis are also possible
- By catch all name
- the name colorAxes (note the e) matches any color axis
- By the single word color, when it is the first axis
- to make it easier to specify the properties of the most used color axis - the first one - it can be referred to without the suffix Axis, resulting in the name color.
- Without id, when it is the first axis, for legend properties and the colors property
-
Legend related properties of the first axis
can be referred to directly, without the axis id.
The same applies to the property
colors.
As an example, the name of the property legendDrawLine can be used directly, instead of its full name: colorAxisLegendDrawLine.
For color axes other than the first, the legend properties still need to be referred to with its full name, like in: color2AxisLegendDrawLine.
The domain of color axes is evaluated at the root chart level. When in a small multiples chart, colors are shared among small charts.
Color axes map values of the "color" visual role.
For more information on options that are specific to only certain color axis types, please see one of the following concrete sub-classes:
- Numeric or discrete domain color axes: AnyColorAxis
- Discrete domain color axes: DiscreteColorAxis
- Heat-grid - numeric domain color axis: HeatGridColorAxis
It can be a single color as documented in pvc.options.varia.ColorString or a single protovis color object (like: pv.color('red') or pv.Color.names.blueviolet).
Additionally, an array of color strings or protovis colors can be specified.
If a function is specified, it can be:
- a protovis scale, like the one obtained by: pv.colors('red', 'blueviolet')
- a scale factory - a function that given the domain values as arguments return a protovis color scale
The default color scheme depends on the axis domain being discrete or numeric.
For discrete domains, the default value is the protovis category10 color scheme:
- value
- value
- value
- value
- value
- value
- value
- value
- value
- value
For numeric domains, the default value is the color scheme:
- value
- value
- value
When a color role is optional and was not specified, but color is still required to show visual elements, this property allows specifying the color with which all visual elements' color attributes will be based on.
The default value is the first color in #colors.
Contrast this option with AnyColorAxis#missing and HeatGridColorAxis#missing.
Allows applying an effect to the colors that an axis outputs.
The default value is null except for color axes that are used only by one of the trend or plot2 plots, and whose colors property was not specified. In these cases, the default value is pvc.brighterColorTransform.
- Context:
- {null}
- Arguments:
- {pv.Color} color
- The color to transform.
- Returns:
- {pv.Color} The transformed color.