Class ColorAxis

All Implemented Interfaces:
Serializable

@Generated(value="This class was generated", comments="Incorrect and missing API should be reported") public class ColorAxis extends Axis

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:
  • Constructor Details

    • ColorAxis

      public ColorAxis()

      Constructor for ColorAxis.

  • Method Details

    • getDataClassColor

      public String getDataClassColor()

      Getter for the field dataClassColor.

      Returns:
      a String object.
      See Also:
    • setDataClassColor

      public void setDataClassColor(String dataClassColor)
      Determines how to set each data class' color if no individual color is set. The default value, tween, computes intermediate colors between minColor and maxColor. The other possible value, category, pulls colors from the global or chart specific colors array.

      Defaults to: tween

      Parameters:
      dataClassColor - a String object.
    • getDataClasses

      public DataClasses getDataClasses()

      Getter for the field dataClasses.

      Returns:
      a DataClasses object.
      See Also:
    • setDataClasses

      public void setDataClasses(DataClasses dataClasses)
      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 - a DataClasses object.
    • getEndOnTick

      public Boolean getEndOnTick()

      Getter for the field endOnTick.

      Specified by:
      getEndOnTick in class Axis
      Returns:
      a Boolean object.
      See Also:
    • setEndOnTick

      public void setEndOnTick(Boolean endOnTick)
      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

      public Color getGridLineColor()

      Getter for the field gridLineColor.

      Specified by:
      getGridLineColor in class Axis
      Returns:
      a Color object.
      See Also:
    • setGridLineColor

      public void setGridLineColor(Color gridLineColor)
      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:
      setGridLineColor in class Axis
      Parameters:
      gridLineColor - a Color object.
    • getGridLineDashStyle

      public DashStyle getGridLineDashStyle()

      Getter for the field gridLineDashStyle.

      Specified by:
      getGridLineDashStyle in class Axis
      Returns:
      a DashStyle object.
      See Also:
    • setGridLineDashStyle

      public void setGridLineDashStyle(DashStyle gridLineDashStyle)
      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:
      setGridLineDashStyle in class Axis
      Parameters:
      gridLineDashStyle - a DashStyle object.
    • getGridLineWidth

      public Number getGridLineWidth()

      Getter for the field gridLineWidth.

      Specified by:
      getGridLineWidth in class Axis
      Returns:
      a Number object.
      See Also:
    • setGridLineWidth

      public void setGridLineWidth(Number gridLineWidth)
      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:
      setGridLineWidth in class Axis
      Parameters:
      gridLineWidth - a Number object.
    • getId

      public String getId()

      Getter for the field id.

      Specified by:
      getId in class Axis
      Returns:
      a String object.
      See Also:
    • setId

      public void setId(String id)
      An id for the axis. This can be used after render time to get a pointer to the axis object through chart.get(). An id for the axis. This can be used after render time to get a pointer to the axis object through chart.get().
      Specified by:
      setId in class Axis
      Parameters:
      id - a String object.
    • getLabels

      public Labels getLabels()

      Getter for the field labels.

      Specified by:
      getLabels in class Axis
      Returns:
      a Labels object.
      See Also:
    • setLabels

      public void setLabels(Labels labels)
      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.

      Specified by:
      setLabels in class Axis
      Parameters:
      labels - a Labels object.
    • getLineColor

      public Color getLineColor()

      Getter for the field lineColor.

      Returns:
      a Color object.
      See Also:
    • setLineColor

      public void setLineColor(Color lineColor)
      The color of the line marking the axis itself.

      Defaults to: #C0D0E0

      Parameters:
      lineColor - a Color object.
    • getLineWidth

      public Number getLineWidth()

      Getter for the field lineWidth.

      Returns:
      a Number object.
      See Also:
    • setLineWidth

      public void setLineWidth(Number lineWidth)
      The width of the line marking the axis itself.

      Defaults to: 0

      Parameters:
      lineWidth - a Number object.
    • getMarker

      public Marker getMarker()

      Getter for the field marker.

      Returns:
      a Marker object.
      See Also:
    • setMarker

      public void setMarker(Marker marker)
      The triangular marker on a scalar color axis that points to the value of the hovered area. To disable the marker, set marker: null.
      Parameters:
      marker - a Marker object.
    • getMaxColor

      public Color getMaxColor()

      Getter for the field maxColor.

      Returns:
      a Color object.
    • setMaxColor

      public void setMaxColor(Color maxColor)

      Setter for the field maxColor.

      Parameters:
      maxColor - a Color object.
    • getMaxPadding

      public Number getMaxPadding()

      Getter for the field maxPadding.

      Specified by:
      getMaxPadding in class Axis
      Returns:
      a Number object.
      See Also:
    • setMaxPadding

      public void setMaxPadding(Number maxPadding)
      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' max option is set or a max extreme is set using axis.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:
      setMaxPadding in class Axis
      Parameters:
      maxPadding - a Number object.
    • getMinColor

      public Color getMinColor()

      Getter for the field minColor.

      Returns:
      a Color object.
      See Also:
    • setMinColor

      public void setMinColor(Color minColor)

      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 - a Color object.
    • getMinPadding

      public Number getMinPadding()

      Getter for the field minPadding.

      Specified by:
      getMinPadding in class Axis
      Returns:
      a Number object.
      See Also:
    • setMinPadding

      public void setMinPadding(Number minPadding)
      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' min option is set or a min extreme is set using axis.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:
      setMinPadding in class Axis
      Parameters:
      minPadding - a Number object.
    • getMinorGridLineColor

      public Color getMinorGridLineColor()

      Getter for the field minorGridLineColor.

      Specified by:
      getMinorGridLineColor in class Axis
      Returns:
      a Color object.
      See Also:
    • setMinorGridLineColor

      public void setMinorGridLineColor(Color minorGridLineColor)
      Color of the minor, secondary grid lines. Color of the minor, secondary grid lines.

      Defaults to: #E0E0E0

      Specified by:
      setMinorGridLineColor in class Axis
      Parameters:
      minorGridLineColor - a Color object.
    • getMinorGridLineDashStyle

      public DashStyle getMinorGridLineDashStyle()

      Getter for the field minorGridLineDashStyle.

      Specified by:
      getMinorGridLineDashStyle in class Axis
      Returns:
      a DashStyle object.
      See Also:
    • setMinorGridLineDashStyle

      public void setMinorGridLineDashStyle(DashStyle minorGridLineDashStyle)
      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:
      setMinorGridLineDashStyle in class Axis
      Parameters:
      minorGridLineDashStyle - a DashStyle object.
    • getMinorGridLineWidth

      public Number getMinorGridLineWidth()

      Getter for the field minorGridLineWidth.

      Specified by:
      getMinorGridLineWidth in class Axis
      Returns:
      a Number object.
      See Also:
    • setMinorGridLineWidth

      public void setMinorGridLineWidth(Number minorGridLineWidth)
      Width of the minor, secondary grid lines. Width of the minor, secondary grid lines.

      Defaults to: 1

      Specified by:
      setMinorGridLineWidth in class Axis
      Parameters:
      minorGridLineWidth - a Number object.
    • getMinorTickColor

      public Color getMinorTickColor()

      Getter for the field minorTickColor.

      Specified by:
      getMinorTickColor in class Axis
      Returns:
      a Color object.
      See Also:
    • setMinorTickColor

      public void setMinorTickColor(Color minorTickColor)
      Color for the minor tick marks. Color for the minor tick marks.

      Defaults to: #A0A0A0

      Specified by:
      setMinorTickColor in class Axis
      Parameters:
      minorTickColor - a Color object.
    • getMinorTickInterval

      public String getMinorTickInterval()

      Getter for the field minorTickInterval.

      Specified by:
      getMinorTickInterval in class Axis
      Returns:
      a String object.
      See Also:
    • setMinorTickInterval

      public void setMinorTickInterval(String minorTickInterval)

      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. If null, 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. If null, 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:
      setMinorTickInterval in class Axis
      Parameters:
      minorTickInterval - a String object.
    • getMinorTickLength

      public Number getMinorTickLength()

      Getter for the field minorTickLength.

      Specified by:
      getMinorTickLength in class Axis
      Returns:
      a Number object.
      See Also:
    • setMinorTickLength

      public void setMinorTickLength(Number minorTickLength)
      The pixel length of the minor tick marks. The pixel length of the minor tick marks.

      Defaults to: 2

      Specified by:
      setMinorTickLength in class Axis
      Parameters:
      minorTickLength - a Number object.
    • getMinorTickPosition

      public TickPosition getMinorTickPosition()

      Getter for the field minorTickPosition.

      Specified by:
      getMinorTickPosition in class Axis
      Returns:
      a TickPosition object.
      See Also:
    • setMinorTickPosition

      public void setMinorTickPosition(TickPosition minorTickPosition)
      The position of the minor tick marks relative to the axis line. Can be one of inside and outside. The position of the minor tick marks relative to the axis line. Can be one of inside and outside.

      Defaults to: outside

      Specified by:
      setMinorTickPosition in class Axis
      Parameters:
      minorTickPosition - a TickPosition object.
    • getMinorTickWidth

      public Number getMinorTickWidth()

      Getter for the field minorTickWidth.

      Specified by:
      getMinorTickWidth in class Axis
      Returns:
      a Number object.
      See Also:
    • setMinorTickWidth

      public void setMinorTickWidth(Number minorTickWidth)
      The pixel width of the minor tick mark. The pixel width of the minor tick mark.

      Defaults to: 0

      Specified by:
      setMinorTickWidth in class Axis
      Parameters:
      minorTickWidth - a Number object.
    • getReversed

      public Boolean getReversed()

      Getter for the field reversed.

      Specified by:
      getReversed in class Axis
      Returns:
      a Boolean object.
      See Also:
    • setReversed

      public void setReversed(Boolean reversed)
      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 to false in a horizontal legend and true in a vertical legend, where the smallest value starts on top.
      Specified by:
      setReversed in class Axis
      Parameters:
      reversed - a Boolean object.
    • getShowFirstLabel

      public Boolean getShowFirstLabel()

      Getter for the field showFirstLabel.

      Specified by:
      getShowFirstLabel in class Axis
      Returns:
      a Boolean object.
      See Also:
    • setShowFirstLabel

      public void setShowFirstLabel(Boolean showFirstLabel)
      Whether to show the first tick label. If labels are enabled, whether to show the first tick label.

      Defaults to: true

      Specified by:
      setShowFirstLabel in class Axis
      Parameters:
      showFirstLabel - a Boolean object.
    • getShowLastLabel

      public Boolean getShowLastLabel()

      Getter for the field showLastLabel.

      Specified by:
      getShowLastLabel in class Axis
      Returns:
      a Boolean object.
      See Also:
    • setShowLastLabel

      public void setShowLastLabel(Boolean showLastLabel)
      Whether to show the last tick label. If labels are enabled, whether to show the last tick label.

      Defaults to: true

      Specified by:
      setShowLastLabel in class Axis
      Parameters:
      showLastLabel - a Boolean object.
    • getStartOnTick

      public Boolean getStartOnTick()

      Getter for the field startOnTick.

      Specified by:
      getStartOnTick in class Axis
      Returns:
      a Boolean object.
      See Also:
    • setStartOnTick

      public void setStartOnTick(Boolean startOnTick)
      Whether to force the axis to start on a tick. Use this option with the minPadding option to control the axis start. Whether to force the axis to start on a tick. Use this option with the maxPadding option to control the axis start.

      Defaults to: true

      Specified by:
      setStartOnTick in class Axis
      Parameters:
      startOnTick - a Boolean object.
    • getTickColor

      public Color getTickColor()

      Getter for the field tickColor.

      Specified by:
      getTickColor in class Axis
      Returns:
      a Color object.
      See Also:
    • setTickColor

      public void setTickColor(Color tickColor)
      Color for the main tick marks. Color for the main tick marks.

      Defaults to: #C0D0E0

      Specified by:
      setTickColor in class Axis
      Parameters:
      tickColor - a Color object.
    • getTickInterval

      public Number getTickInterval()

      Getter for the field tickInterval.

      Specified by:
      getTickInterval in class Axis
      Returns:
      a Number object.
      See Also:
    • setTickInterval

      public void setTickInterval(Number tickInterval)

      The interval of the tick marks in axis units. When null, the tick interval is computed to approximately follow the tickPixelInterval on linear and datetime axes. On categorized axes, a null tickInterval will default to 1, one category. Note that datetime axes are based on milliseconds, so for example an interval of one day is expressed as 24 * 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. When null, the tick interval is computed to approximately follow the tickPixelInterval.
      Specified by:
      setTickInterval in class Axis
      Parameters:
      tickInterval - a Number object.
    • getTickLength

      public Number getTickLength()

      Getter for the field tickLength.

      Specified by:
      getTickLength in class Axis
      Returns:
      a Number object.
      See Also:
    • setTickLength

      public void setTickLength(Number tickLength)
      The pixel length of the main tick marks. The pixel length of the main tick marks.

      Defaults to: 10

      Specified by:
      setTickLength in class Axis
      Parameters:
      tickLength - a Number object.
    • getTickPixelInterval

      public Number getTickPixelInterval()

      Getter for the field tickPixelInterval.

      Specified by:
      getTickPixelInterval in class Axis
      Returns:
      a Number object.
      See Also:
    • setTickPixelInterval

      public void setTickPixelInterval(Number tickPixelInterval)
      If tickInterval is null this option sets the approximate pixel interval of the tick marks. Not applicable to categorized axis. If tickInterval is null this option sets the approximate pixel interval of the tick marks.

      Defaults to: 72

      Specified by:
      setTickPixelInterval in class Axis
      Parameters:
      tickPixelInterval - a Number object.
    • getTickPosition

      public TickPosition getTickPosition()

      Getter for the field tickPosition.

      Specified by:
      getTickPosition in class Axis
      Returns:
      a TickPosition object.
      See Also:
    • setTickPosition

      public void setTickPosition(TickPosition tickPosition)
      The position of the major tick marks relative to the axis line. Can be one of inside and outside. The position of the major tick marks relative to the axis line. Can be one of inside and outside.

      Defaults to: outside

      Specified by:
      setTickPosition in class Axis
      Parameters:
      tickPosition - a TickPosition object.
    • getTickPositions

      public Number[] getTickPositions()

      Getter for the field tickPositions.

      Specified by:
      getTickPositions in class Axis
      Returns:
      an array of Number objects.
      See Also:
    • setTickPositions

      public void setTickPositions(Number[] tickPositions)
      An array defining where the ticks are laid out on the axis. This overrides the default behaviour of tickPixelInterval and tickInterval.
      Specified by:
      setTickPositions in class Axis
      Parameters:
      tickPositions - an array of Number objects.
    • getTickWidth

      public Number getTickWidth()

      Getter for the field tickWidth.

      Specified by:
      getTickWidth in class Axis
      Returns:
      a Number object.
      See Also:
    • setTickWidth

      public void setTickWidth(Number tickWidth)
      The pixel width of the major tick marks. The pixel width of the major tick marks.

      Defaults to: 0

      Specified by:
      setTickWidth in class Axis
      Parameters:
      tickWidth - a Number object.
    • getType

      public String getType()

      Getter for the field type.

      Returns:
      a String object.
      See Also:
    • setType

      public void setType(String type)
      The type of interpolation to use for the color axis. Can be linear or logarithmic.

      Defaults to: linear

      Parameters:
      type - a String object.
    • getStops

      public Stop[] getStops()

      Getter for the field stops.

      Returns:
      an array of Stop objects.
      See Also:
    • setStops

      public void setStops(Stop... stops)

      Setter for the field stops.

      Parameters:
      stops - a Stop object.
    • addStop

      public void addStop(Stop stop)
      Adds stop to the stops array
      Parameters:
      stop - to add
      See Also:
    • removeStop

      public void removeStop(Stop stop)
      Removes first occurrence of stop in stops array
      Parameters:
      stop - to remove
      See Also: