Class pvc.options.axes.DiscreteColorAxis
Extends
ColorAxis.
Constructor Attributes | Constructor Name and Description |
---|---|
The options documentation class of a discrete domain color axis.
|
Field Attributes | Field Name and Description |
---|---|
Discrete > Scale | |
Allows reserving colors to certain color scale keys.
|
|
Discrete > Style | |
What happens when the user clicks a legend item
(applies to color axes of discrete domain).
|
|
Forces a rule to be shown or not in the marker zone
(applies to color axes of discrete domain).
|
|
Forces a shape to be shown or not in the marker zone
(applies to color axes of discrete domain).
|
|
Forces a given shape to be used in the marker zone
(applies to color axes of discrete domain).
|
|
Indicates if the legend items of the color axis should be visible
(applies to color axes of discrete domain).
|
|
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.
|
See ColorAxis for additional information.
- Default Value:
- false
Color scale keys are the values of the color role. By default, the color role is bound to the dimensions of the series role. Color scale keys that are not mapped, receive colors taken from #colors. Colors in #colors that are also present in the color map are ignored.
Assuming the color role is bound to the grouping "territory, country", the following map would reserve the colors red and green to Canada and Portugal, respectively:
chartOptions.colorMap = { "NA~Canada": "red", "EMEA~Portugal": "green" };
Assumes that the default pvc.options.charts.BasicChart#dataSeparator is used.
Note that when pvc.options.charts.Chart#hoverable is true, the legend item marker will be hoverable.
When pvc.options.charts.Chart#selectable is true, the legend item marker will be selectable, whatever the value of this property is. In that case, only the label part of the legend marker, will respect this property.
- Default Value:
- 'toggleVisible'
The default value depends on the chart type.
The default value depends on the chart type.
The default value depends on the chart type.
- Default Value:
- true
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
- Borrowed from:
- ColorAxis
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.
- Borrowed from:
- ColorAxis
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.
- Borrowed from:
- ColorAxis