Class ColorAxis
- All Implemented Interfaces:
Serializable
A color axis for choropleth mapping. Visually, the color axis will appear as a gradient or as separate items inside the legend, depending on whether the axis is scalar or based on data classes.
For supported color formats, see the docs article about colors.
A scalar color axis is represented by a gradient. The colors either range between the minColor and the maxColor, or for more fine grained control the colors can be defined in stops. Often times, the color axis needs to be adjusted to get the right color spread for the data. In addition to stops, consider using a logarithmic axis type, or setting min and max to avoid the colors being determined by outliers.
When dataClasses are used, the ranges are subdivided into separate classes like categories based on their values. This can be used for ranges between two values, but also for a true category. However, when your data is categorized, it may be as convenient to add each category to a separate series.
See the Axis object for programmatic access to the axis.
- Version:
- $Id: $Id
- Author:
- Vaadin
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds stop to the stops arrayGetter for the fielddataClassColor.Getter for the fielddataClasses.Getter for the fieldendOnTick.Getter for the fieldgridLineColor.Getter for the fieldgridLineDashStyle.Getter for the fieldgridLineWidth.getId()Getter for the fieldid.Getter for the fieldlabels.Getter for the fieldlineColor.Getter for the fieldlineWidth.Getter for the fieldmarker.Getter for the fieldmaxColor.Getter for the fieldmaxPadding.Getter for the fieldminColor.Getter for the fieldminorGridLineColor.Getter for the fieldminorGridLineDashStyle.Getter for the fieldminorGridLineWidth.Getter for the fieldminorTickColor.Getter for the fieldminorTickInterval.Getter for the fieldminorTickLength.Getter for the fieldminorTickPosition.Getter for the fieldminorTickWidth.Getter for the fieldminPadding.Getter for the fieldreversed.Getter for the fieldshowFirstLabel.Getter for the fieldshowLastLabel.Getter for the fieldstartOnTick.Stop[]getStops()Getter for the fieldstops.Getter for the fieldtickColor.Getter for the fieldtickInterval.Getter for the fieldtickLength.Getter for the fieldtickPixelInterval.Getter for the fieldtickPosition.Number[]Getter for the fieldtickPositions.Getter for the fieldtickWidth.getType()Getter for the fieldtype.voidremoveStop(Stop stop) Removes first occurrence of stop in stops arrayvoidsetDataClassColor(String dataClassColor) Determines how to set each data class' color if no individual color is set.voidsetDataClasses(DataClasses dataClasses) An array of data classes or ranges for the choropleth map.voidsetEndOnTick(Boolean endOnTick) Whether to force the axis to end on a tick.voidsetGridLineColor(Color gridLineColor) Color of the grid lines extending the ticks across the plot area.voidsetGridLineDashStyle(DashStyle gridLineDashStyle) The dash or dot style of the grid lines.voidsetGridLineWidth(Number gridLineWidth) The width of the grid lines extending the ticks across the plot area.voidAn id for the axis.voidThe axis labels show the number or category for each tick.voidsetLineColor(Color lineColor) The color of the line marking the axis itself.voidsetLineWidth(Number lineWidth) The width of the line marking the axis itself.voidThe triangular marker on a scalar color axis that points to the value of the hovered area.voidsetMaxColor(Color maxColor) Setter for the fieldmaxColor.voidsetMaxPadding(Number maxPadding) Padding of the max value relative to the length of the axis.voidsetMinColor(Color minColor) The color to represent the minimum of the color axis.voidsetMinorGridLineColor(Color minorGridLineColor) Color of the minor, secondary grid lines.voidsetMinorGridLineDashStyle(DashStyle minorGridLineDashStyle) The dash or dot style of the minor grid lines.voidsetMinorGridLineWidth(Number minorGridLineWidth) Width of the minor, secondary grid lines.voidsetMinorTickColor(Color minorTickColor) Color for the minor tick marks.voidsetMinorTickInterval(String minorTickInterval) Tick interval in scale units for the minor ticks.voidsetMinorTickLength(Number minorTickLength) The pixel length of the minor tick marks.voidsetMinorTickPosition(TickPosition minorTickPosition) The position of the minor tick marks relative to the axis line.voidsetMinorTickWidth(Number minorTickWidth) The pixel width of the minor tick mark.voidsetMinPadding(Number minPadding) Padding of the min value relative to the length of the axis.voidsetReversed(Boolean reversed) Whether to reverse the axis so that the highest number is closest to the origin.voidsetShowFirstLabel(Boolean showFirstLabel) Whether to show the first tick label.voidsetShowLastLabel(Boolean showLastLabel) Whether to show the last tick label.voidsetStartOnTick(Boolean startOnTick) Whether to force the axis to start on a tick.voidSetter for the fieldstops.voidsetTickColor(Color tickColor) Color for the main tick marks.voidsetTickInterval(Number tickInterval) The interval of the tick marks in axis units.voidsetTickLength(Number tickLength) The pixel length of the main tick marks.voidsetTickPixelInterval(Number tickPixelInterval) If tickInterval isnullthis option sets the approximate pixel interval of the tick marks.voidsetTickPosition(TickPosition tickPosition) The position of the major tick marks relative to the axis line.voidsetTickPositions(Number[] tickPositions) An array defining where the ticks are laid out on the axis.voidsetTickWidth(Number tickWidth) The pixel width of the major tick marks.voidThe type of interpolation to use for the color axis.Methods inherited from class com.vaadin.componentfactory.maps.model.Axis
getConfiguration, getMax, getMin, setAxisIndex, setConfiguration, setExtremes, setExtremes, setExtremes, setMax, setMin
-
Constructor Details
-
ColorAxis
public ColorAxis()Constructor for ColorAxis.
-
-
Method Details
-
getDataClassColor
Getter for the field
dataClassColor.- Returns:
- a
Stringobject. - See Also:
-
setDataClassColor
Determines how to set each data class' color if no individual color is set. The default value,tween, computes intermediate colors betweenminColorandmaxColor. The other possible value,category, pulls colors from the global or chart specific colors array.Defaults to: tween
- Parameters:
dataClassColor- aStringobject.
-
getDataClasses
Getter for the field
dataClasses.- Returns:
- a
DataClassesobject. - See Also:
-
setDataClasses
An array of data classes or ranges for the choropleth map. If none given, the color axis is scalar and values are distributed as a gradient between the minimum and maximum colors.- Parameters:
dataClasses- aDataClassesobject.
-
getEndOnTick
Getter for the field
endOnTick.- Specified by:
getEndOnTickin classAxis- Returns:
- a
Booleanobject. - See Also:
-
setEndOnTick
Whether to force the axis to end on a tick. Use this option with the maxPadding option to control the axis end.Defaults to: true
-
getGridLineColor
Getter for the field
gridLineColor.- Specified by:
getGridLineColorin classAxis- Returns:
- a
Colorobject. - See Also:
-
setGridLineColor
Color of the grid lines extending the ticks across the plot area. Color of the grid lines extending from the axis across the gradient.Defaults to: #C0C0C0
- Specified by:
setGridLineColorin classAxis- Parameters:
gridLineColor- aColorobject.
-
getGridLineDashStyle
Getter for the field
gridLineDashStyle.- Specified by:
getGridLineDashStylein classAxis- Returns:
- a
DashStyleobject. - See Also:
-
setGridLineDashStyle
The dash or dot style of the grid lines. The dash or dot style of the grid lines. For possible values, see this demonstration.Defaults to: Solid
- Specified by:
setGridLineDashStylein classAxis- Parameters:
gridLineDashStyle- aDashStyleobject.
-
getGridLineWidth
Getter for the field
gridLineWidth.- Specified by:
getGridLineWidthin classAxis- Returns:
- a
Numberobject. - See Also:
-
setGridLineWidth
The width of the grid lines extending the ticks across the plot area. The width of the grid lines extending from the axis across the gradient of a scalar color axis.Defaults to: 1
- Specified by:
setGridLineWidthin classAxis- Parameters:
gridLineWidth- aNumberobject.
-
getId
Getter for the field
id. -
setId
An id for the axis. This can be used after render time to get a pointer to the axis object throughchart.get(). An id for the axis. This can be used after render time to get a pointer to the axis object throughchart.get(). -
getLabels
Getter for the field
labels. -
setLabels
The axis labels show the number or category for each tick.The axis labels show the number for each tick.
For more live examples on label options, see xAxis.labels in the Highcharts API.
-
getLineColor
Getter for the field
lineColor.- Returns:
- a
Colorobject. - See Also:
-
setLineColor
The color of the line marking the axis itself.Defaults to: #C0D0E0
- Parameters:
lineColor- aColorobject.
-
getLineWidth
Getter for the field
lineWidth.- Returns:
- a
Numberobject. - See Also:
-
setLineWidth
The width of the line marking the axis itself.Defaults to: 0
- Parameters:
lineWidth- aNumberobject.
-
getMarker
Getter for the field
marker.- Returns:
- a
Markerobject. - See Also:
-
setMarker
The triangular marker on a scalar color axis that points to the value of the hovered area. To disable the marker, setmarker: null.- Parameters:
marker- aMarkerobject.
-
getMaxColor
Getter for the field
maxColor.- Returns:
- a
Colorobject.
-
setMaxColor
Setter for the field
maxColor.- Parameters:
maxColor- aColorobject.
-
getMaxPadding
Getter for the field
maxPadding.- Specified by:
getMaxPaddingin classAxis- Returns:
- a
Numberobject. - See Also:
-
setMaxPadding
Padding of the max value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. This is useful when you don't want the highest data value to appear on the edge of the plot area. When the axis'maxoption is set or a max extreme is set usingaxis.setExtremes(), the maxPadding will be ignored. Padding of the max value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer.Defaults to: 0.05
- Specified by:
setMaxPaddingin classAxis- Parameters:
maxPadding- aNumberobject.
-
getMinColor
Getter for the field
minColor.- Returns:
- a
Colorobject. - See Also:
-
setMinColor
The color to represent the minimum of the color axis. Unless dataClasses or stops are set, the gradient starts at this value.
If dataClasses are set, the color is based on minColor and maxColor unless a color is set for each data class, or the dataClassColor is set.
Defaults to: #EFEFFF
- Parameters:
minColor- aColorobject.
-
getMinPadding
Getter for the field
minPadding.- Specified by:
getMinPaddingin classAxis- Returns:
- a
Numberobject. - See Also:
-
setMinPadding
Padding of the min value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. This is useful when you don't want the lowest data value to appear on the edge of the plot area. When the axis'minoption is set or a min extreme is set usingaxis.setExtremes(), the minPadding will be ignored. Padding of the min value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer.Defaults to: 0.05
- Specified by:
setMinPaddingin classAxis- Parameters:
minPadding- aNumberobject.
-
getMinorGridLineColor
Getter for the field
minorGridLineColor.- Specified by:
getMinorGridLineColorin classAxis- Returns:
- a
Colorobject. - See Also:
-
setMinorGridLineColor
Color of the minor, secondary grid lines. Color of the minor, secondary grid lines.Defaults to: #E0E0E0
- Specified by:
setMinorGridLineColorin classAxis- Parameters:
minorGridLineColor- aColorobject.
-
getMinorGridLineDashStyle
Getter for the field
minorGridLineDashStyle.- Specified by:
getMinorGridLineDashStylein classAxis- Returns:
- a
DashStyleobject. - See Also:
-
setMinorGridLineDashStyle
The dash or dot style of the minor grid lines. The dash or dot style of the minor grid lines. For possible values, see this demonstration.Defaults to: Solid
- Specified by:
setMinorGridLineDashStylein classAxis- Parameters:
minorGridLineDashStyle- aDashStyleobject.
-
getMinorGridLineWidth
Getter for the field
minorGridLineWidth.- Specified by:
getMinorGridLineWidthin classAxis- Returns:
- a
Numberobject. - See Also:
-
setMinorGridLineWidth
Width of the minor, secondary grid lines. Width of the minor, secondary grid lines.Defaults to: 1
- Specified by:
setMinorGridLineWidthin classAxis- Parameters:
minorGridLineWidth- aNumberobject.
-
getMinorTickColor
Getter for the field
minorTickColor.- Specified by:
getMinorTickColorin classAxis- Returns:
- a
Colorobject. - See Also:
-
setMinorTickColor
Color for the minor tick marks. Color for the minor tick marks.Defaults to: #A0A0A0
- Specified by:
setMinorTickColorin classAxis- Parameters:
minorTickColor- aColorobject.
-
getMinorTickInterval
Getter for the field
minorTickInterval.- Specified by:
getMinorTickIntervalin classAxis- Returns:
- a
Stringobject. - See Also:
-
setMinorTickInterval
Tick interval in scale units for the minor ticks. On a linear axis, if
"auto", the minor tick interval is calculated as a fifth of the tickInterval. Ifnull, minor ticks are not shown.On logarithmic axes, the unit is the power of the value. For example, setting the minorTickInterval to 1 puts one tick on each of 0.1, 1, 10, 100 etc. Setting the minorTickInterval to 0.1 produces 9 ticks between 1 and 10, 10 and 100 etc. A minorTickInterval of "auto" on a log axis results in a best guess, attempting to enter approximately 5 minor ticks between each major tick.
If user settings dictate minor ticks to become too dense, they don't make sense, and will be ignored to prevent performance problems.
On axes using
categories, minor ticks are not supported.Tick interval in scale units for the minor ticks. On a linear axis, if
"auto", the minor tick interval is calculated as a fifth of the tickInterval. Ifnull, minor ticks are not shown.On logarithmic axes, the unit is the power of the value. For example, setting the minorTickInterval to 1 puts one tick on each of 0.1, 1, 10, 100 etc. Setting the minorTickInterval to 0.1 produces 9 ticks between 1 and 10, 10 and 100 etc. A minorTickInterval of "auto" on a log axis results in a best guess, attempting to enter approximately 5 minor ticks between each major tick.
If user settings dictate minor ticks to become too dense, they don't make sense, and will be ignored to prevent performance problems.
- Specified by:
setMinorTickIntervalin classAxis- Parameters:
minorTickInterval- aStringobject.
-
getMinorTickLength
Getter for the field
minorTickLength.- Specified by:
getMinorTickLengthin classAxis- Returns:
- a
Numberobject. - See Also:
-
setMinorTickLength
The pixel length of the minor tick marks. The pixel length of the minor tick marks.Defaults to: 2
- Specified by:
setMinorTickLengthin classAxis- Parameters:
minorTickLength- aNumberobject.
-
getMinorTickPosition
Getter for the field
minorTickPosition.- Specified by:
getMinorTickPositionin classAxis- Returns:
- a
TickPositionobject. - See Also:
-
setMinorTickPosition
The position of the minor tick marks relative to the axis line. Can be one ofinsideandoutside. The position of the minor tick marks relative to the axis line. Can be one ofinsideandoutside.Defaults to: outside
- Specified by:
setMinorTickPositionin classAxis- Parameters:
minorTickPosition- aTickPositionobject.
-
getMinorTickWidth
Getter for the field
minorTickWidth.- Specified by:
getMinorTickWidthin classAxis- Returns:
- a
Numberobject. - See Also:
-
setMinorTickWidth
The pixel width of the minor tick mark. The pixel width of the minor tick mark.Defaults to: 0
- Specified by:
setMinorTickWidthin classAxis- Parameters:
minorTickWidth- aNumberobject.
-
getReversed
Getter for the field
reversed.- Specified by:
getReversedin classAxis- Returns:
- a
Booleanobject. - See Also:
-
setReversed
Whether to reverse the axis so that the highest number is closest to the origin. Whether to reverse the axis so that the highest number is closest to the origin. Defaults tofalsein a horizontal legend andtruein a vertical legend, where the smallest value starts on top.- Specified by:
setReversedin classAxis- Parameters:
reversed- aBooleanobject.
-
getShowFirstLabel
Getter for the field
showFirstLabel.- Specified by:
getShowFirstLabelin classAxis- Returns:
- a
Booleanobject. - See Also:
-
setShowFirstLabel
Whether to show the first tick label. If labels are enabled, whether to show the first tick label.Defaults to: true
- Specified by:
setShowFirstLabelin classAxis- Parameters:
showFirstLabel- aBooleanobject.
-
getShowLastLabel
Getter for the field
showLastLabel.- Specified by:
getShowLastLabelin classAxis- Returns:
- a
Booleanobject. - See Also:
-
setShowLastLabel
Whether to show the last tick label. If labels are enabled, whether to show the last tick label.Defaults to: true
- Specified by:
setShowLastLabelin classAxis- Parameters:
showLastLabel- aBooleanobject.
-
getStartOnTick
Getter for the field
startOnTick.- Specified by:
getStartOnTickin classAxis- Returns:
- a
Booleanobject. - See Also:
-
setStartOnTick
Whether to force the axis to start on a tick. Use this option with theminPaddingoption to control the axis start. Whether to force the axis to start on a tick. Use this option with themaxPaddingoption to control the axis start.Defaults to: true
- Specified by:
setStartOnTickin classAxis- Parameters:
startOnTick- aBooleanobject.
-
getTickColor
Getter for the field
tickColor.- Specified by:
getTickColorin classAxis- Returns:
- a
Colorobject. - See Also:
-
setTickColor
Color for the main tick marks. Color for the main tick marks.Defaults to: #C0D0E0
- Specified by:
setTickColorin classAxis- Parameters:
tickColor- aColorobject.
-
getTickInterval
Getter for the field
tickInterval.- Specified by:
getTickIntervalin classAxis- Returns:
- a
Numberobject. - See Also:
-
setTickInterval
The interval of the tick marks in axis units. When
null, the tick interval is computed to approximately follow thetickPixelIntervalon linear and datetime axes. On categorized axes, anulltickInterval will default to 1, one category. Note that datetime axes are based on milliseconds, so for example an interval of one day is expressed as24 * 3600 * 1000.On logarithmic axes, the tickInterval is based on powers, so a tickInterval of 1 means one tick on each of 0.1, 1, 10, 100 etc. A tickInterval of 2 means a tick of 0.1, 10, 1000 etc. A tickInterval of 0.2 puts a tick on 0.1, 0.2, 0.4, 0.6, 0.8, 1, 2, 4, 6, 8, 10, 20, 40 etc.
If the tickInterval is too dense for labels to be drawn, Highcharts may remove ticks.
The interval of the tick marks in axis units. Whennull, the tick interval is computed to approximately follow thetickPixelInterval.- Specified by:
setTickIntervalin classAxis- Parameters:
tickInterval- aNumberobject.
-
getTickLength
Getter for the field
tickLength.- Specified by:
getTickLengthin classAxis- Returns:
- a
Numberobject. - See Also:
-
setTickLength
The pixel length of the main tick marks. The pixel length of the main tick marks.Defaults to: 10
- Specified by:
setTickLengthin classAxis- Parameters:
tickLength- aNumberobject.
-
getTickPixelInterval
Getter for the field
tickPixelInterval.- Specified by:
getTickPixelIntervalin classAxis- Returns:
- a
Numberobject. - See Also:
-
setTickPixelInterval
If tickInterval isnullthis option sets the approximate pixel interval of the tick marks. Not applicable to categorized axis. If tickInterval isnullthis option sets the approximate pixel interval of the tick marks.Defaults to: 72
- Specified by:
setTickPixelIntervalin classAxis- Parameters:
tickPixelInterval- aNumberobject.
-
getTickPosition
Getter for the field
tickPosition.- Specified by:
getTickPositionin classAxis- Returns:
- a
TickPositionobject. - See Also:
-
setTickPosition
The position of the major tick marks relative to the axis line. Can be one ofinsideandoutside. The position of the major tick marks relative to the axis line. Can be one ofinsideandoutside.Defaults to: outside
- Specified by:
setTickPositionin classAxis- Parameters:
tickPosition- aTickPositionobject.
-
getTickPositions
Getter for the field
tickPositions.- Specified by:
getTickPositionsin classAxis- Returns:
- an array of
Numberobjects. - See Also:
-
setTickPositions
An array defining where the ticks are laid out on the axis. This overrides the default behaviour oftickPixelIntervalandtickInterval.- Specified by:
setTickPositionsin classAxis- Parameters:
tickPositions- an array ofNumberobjects.
-
getTickWidth
Getter for the field
tickWidth.- Specified by:
getTickWidthin classAxis- Returns:
- a
Numberobject. - See Also:
-
setTickWidth
The pixel width of the major tick marks. The pixel width of the major tick marks.Defaults to: 0
- Specified by:
setTickWidthin classAxis- Parameters:
tickWidth- aNumberobject.
-
getType
Getter for the field
type.- Returns:
- a
Stringobject. - See Also:
-
setType
The type of interpolation to use for the color axis. Can belinearorlogarithmic.Defaults to: linear
- Parameters:
type- aStringobject.
-
getStops
Getter for the field
stops.- Returns:
- an array of
Stopobjects. - See Also:
-
setStops
Setter for the field
stops.- Parameters:
stops- aStopobject.
-
addStop
Adds stop to the stops array- Parameters:
stop- to add- See Also:
-
removeStop
Removes first occurrence of stop in stops array- Parameters:
stop- to remove- See Also:
-