Class AxisImpl

java.lang.Object
io.deephaven.plot.AxisImpl
All Implemented Interfaces:
Axis, PlotExceptionCause, Serializable

public class AxisImpl extends Object implements Axis, PlotExceptionCause
Represents an axis.
See Also:
  • Field Details

  • Constructor Details

    • AxisImpl

      protected AxisImpl(AxisImpl axis, ChartImpl chart)
      Creates a copy of an Axis using a different chart.
      Parameters:
      axis - axis to copy.
      chart - new chart.
  • Method Details

    • copy

      public AxisImpl copy(ChartImpl chart)
      Creates a copy of this Axis using a different chart.
      Parameters:
      chart - new chart.
      Returns:
      axis copy.
    • getPlotInfo

      public PlotInfo getPlotInfo()
      Specified by:
      getPlotInfo in interface PlotExceptionCause
    • dim

      public int dim()
      Gets the dimensionality of this AxisImpl.
      Returns:
      this AxisImpl's dimensionality
    • id

      public int id()
      Gets this AxisImpl's id.
      Returns:
      this AxisImpl's id
    • getColor

      public Paint getColor()
      Gets this AxisImpl's color.
      Returns:
      this AxisImpl's color
    • chart

      public ChartImpl chart()
      Gets this AxisImpl's id.
      Returns:
      this AxisImpl's id
    • getType

      public AxisImpl.Type getType()
      Gets the type of axis.
      Returns:
      type of axis.
    • isLog

      public boolean isLog()
      Whether this is a logarithmic axis.
      Returns:
      if this is a logarithmic axis, true; false otherwise
    • getLabel

      public String getLabel()
      Gets this AxisImpl's label.
      Returns:
      this AxisImpl's label
    • getLabelFont

      public Font getLabelFont()
      Gets the Font of this AxisImpl's label.
      Returns:
      this AxisImpl's label's Font
    • getTicksFont

      public Font getTicksFont()
      Gets the Font of this AxisImpl's tick labels.
      Returns:
      this AxisImpl's tick label's Font
    • getFormat

      public AxisFormat getFormat()
      Gets the AxisFormat of this AxisImpl.
      Returns:
      this AxisImpl's AxisFormat
    • getFormatPattern

      public String getFormatPattern()
      Gets the format pattern for this AxisImpl's tick labels.
      Returns:
      this AxisImpl's tick labels' format pattern
    • getInvert

      public boolean getInvert()
      Gets whether to invert this AxisImpl.
      Returns:
      whether to invert this AxisImpl.
    • getMinRange

      public double getMinRange()
      Gets the minimum of this AxisImpl's range.
      Returns:
      minimum of this AxisImpl's range
    • getMaxRange

      public double getMaxRange()
      Gets the maximum of this AxisImpl's range.
      Returns:
      maximum of this AxisImpl's range
    • isMinorTicksVisible

      public boolean isMinorTicksVisible()
      Whether the minor ticks are drawn.
      Returns:
      if the minor ticks will be drawn, true; otherwise false
    • isMajorTicksVisible

      public boolean isMajorTicksVisible()
      Whether the major ticks are drawn.
      Returns:
      if the major ticks will be drawn, true; otherwise false
    • getMinorTickCount

      public int getMinorTickCount()
      Gets the number of minor ticks between consecutive major ticks.
      Returns:
      number of minor ticks between consecutive major ticks
    • getGapBetweenMajorTicks

      public double getGapBetweenMajorTicks()
      Gets the gap between consecutive major ticks.
      Returns:
      the gap between consecutive major ticks
    • getMajorTickLocations

      public double[] getMajorTickLocations()
      Gets the locations of the major ticks.
      Returns:
      the locations of the major ticks
    • getTickLabelAngle

      public double getTickLabelAngle()
      Gets the angle in degrees at which the tick label text will be drawn.
      Returns:
      angle at which the tick label text will be drawn
    • getAxisTransform

      public AxisTransform getAxisTransform()
      Gets the AxisTransform of this AxisImpl.
      Returns:
      this AxisImpl's AxisTransform
    • isTimeAxis

      public boolean isTimeAxis()
      Whether this axis is time axis.
      Returns:
      boolean informing whether this axis is time axis
    • setTimeAxis

      public void setTimeAxis(boolean timeAxis)
      Sets the boolean representing whether this axis is time axis
      Parameters:
      timeAxis - boolean representing whether this axis is time axis
    • addPartitionedTableHandle

      public void addPartitionedTableHandle(PartitionedTableHandle map)
    • getSwappableTables

      public Set<SwappableTable> getSwappableTables()
    • getPartitionedTableHandles

      public Set<PartitionedTableHandle> getPartitionedTableHandles()
    • addSwappableTable

      public void addSwappableTable(SwappableTable st)
    • addOneClickChartModifier

      public void addOneClickChartModifier(OneClickChartModifier oneClickChartModifier)
    • getOneClickChartModifiers

      public Set<OneClickChartModifier> getOneClickChartModifiers()
    • axisFormat

      public AxisImpl axisFormat(AxisFormat axisFormat)
      Description copied from interface: Axis
      Sets the AxisFormat for this Axis.
      Specified by:
      axisFormat in interface Axis
      Parameters:
      axisFormat - axis format
      Returns:
      this Axis
    • axisFormatPattern

      public AxisImpl axisFormatPattern(String axisFormatPattern)
      Description copied from interface: Axis
      Sets the format pattern for this Axis's labels.
      Specified by:
      axisFormatPattern in interface Axis
      Parameters:
      axisFormatPattern - axis format pattern
      Returns:
      this Axis
    • axisColor

      public AxisImpl axisColor(Paint color)
      Description copied from interface: Axis
      Sets the color for this Axis line and tick marks.
      Specified by:
      axisColor in interface Axis
      Parameters:
      color - color
      Returns:
      this Axis
    • axisColor

      public AxisImpl axisColor(String color)
      Description copied from interface: Axis
      Sets the color for this Axis line and tick marks.
      Specified by:
      axisColor in interface Axis
      Parameters:
      color - color
      Returns:
      this Axis
    • axisLabel

      public AxisImpl axisLabel(String label)
      Description copied from interface: Axis
      Sets the label for this Axis.
      Specified by:
      axisLabel in interface Axis
      Parameters:
      label - label
      Returns:
      this Axis
    • axisLabelFont

      public AxisImpl axisLabelFont(Font font)
      Description copied from interface: Axis
      Sets the font for this Axis's label.
      Specified by:
      axisLabelFont in interface Axis
      Parameters:
      font - font
      Returns:
      this Axis
    • axisLabelFont

      public AxisImpl axisLabelFont(String family, String style, int size)
      Description copied from interface: Axis
      Sets the font for this Axis's label.
      Specified by:
      axisLabelFont in interface Axis
      Parameters:
      family - font family; if null, set to Arial
      style - font style; if null, set to Font.FontStyle PLAIN
      size - the point size of the Font
      Returns:
      this Axis
    • ticksFont

      public AxisImpl ticksFont(Font font)
      Description copied from interface: Axis
      Sets the font for this Axis's ticks.
      Specified by:
      ticksFont in interface Axis
      Parameters:
      font - font
      Returns:
      this Axis
    • ticksFont

      public AxisImpl ticksFont(String family, String style, int size)
      Description copied from interface: Axis
      Sets the font for this Axis's ticks.
      Specified by:
      ticksFont in interface Axis
      Parameters:
      family - font family; if null, set to Arial
      style - font style; if null, set to Font.FontStyle PLAIN
      size - the point size of the Font
      Returns:
      this Axis
    • transform

      public AxisImpl transform(AxisTransform transform)
      Description copied from interface: Axis
      Sets the AxisTransform for this Axis.
      Specified by:
      transform in interface Axis
      Parameters:
      transform - transform
      Returns:
      this Axis
    • log

      public AxisImpl log()
      Description copied from interface: Axis
      Sets the AxisTransform as log base 10.
      Specified by:
      log in interface Axis
      Returns:
      this Axis
    • log

      public Axis log(boolean useLog)
      Description copied from interface: Axis
      Sets the AxisTransform as log base 10.
      Specified by:
      log in interface Axis
      Parameters:
      useLog - true to use a log axis transform; false to use a linear axis transform.
      Returns:
      this Axis
    • businessTime

      public AxisImpl businessTime(BusinessCalendar calendar)
      Description copied from interface: Axis
      Specified by:
      businessTime in interface Axis
      Parameters:
      calendar - business calendar of the AxisTransformBusinessCalendar
      Returns:
      this Axis using the specified business calendar.
    • businessTime

      public AxisImpl businessTime(SelectableDataSet sds, String calendar)
      Description copied from interface: Axis
      Specified by:
      businessTime in interface Axis
      Parameters:
      sds - selectable data set (e.g. OneClick filterable table) containing the business calendar.
      calendar - name of a column containing String values, where each value is the name of a BusinessCalendar.
      Returns:
      this Axis using the business calendar from row 0 of the filtered sds for the business calendar. If no value is found, no transform will be applied.
    • businessTime

      public AxisImpl businessTime()
      Description copied from interface: Axis
      Specified by:
      businessTime in interface Axis
      Returns:
      this Axis using the default business calendar.
    • businessTime

      public AxisImpl businessTime(boolean useBusinessTime)
      Description copied from interface: Axis
      Specified by:
      businessTime in interface Axis
      Parameters:
      useBusinessTime - true to use a business time axis transform; false to use a linear axis transform.
      Returns:
      this Axis using the default business calendar or this Axis using a linear axis transform.
    • invert

      public AxisImpl invert()
      Description copied from interface: Axis
      Inverts this Axis so that larger values are closer to the origin.
      Specified by:
      invert in interface Axis
      Returns:
      this Axes
    • invert

      public AxisImpl invert(boolean invert)
      Description copied from interface: Axis
      Inverts this Axis so that larger values are closer to the origin.
      Specified by:
      invert in interface Axis
      Parameters:
      invert - if true, larger values will be closer to the origin; otherwise, smaller values will be closer to the origin.
      Returns:
      this Axes
    • range

      public AxisImpl range(double min, double max)
      Description copied from interface: Axis
      Sets the range of this Axis to [min, max] inclusive.
      Specified by:
      range in interface Axis
      Parameters:
      min - minimum of the range
      max - maximum of the range
      Returns:
      this Axis
    • min

      public AxisImpl min(double min)
      Description copied from interface: Axis
      Sets the minimum range of this Axis.
      Specified by:
      min in interface Axis
      Parameters:
      min - minimum of the range
      Returns:
      this Axis
    • max

      public AxisImpl max(double max)
      Description copied from interface: Axis
      Sets the maximum range of this Axis.
      Specified by:
      max in interface Axis
      Parameters:
      max - maximum of the range
      Returns:
      this Axis
    • min

      public AxisImpl min(SelectableDataSet sds, String min)
      Description copied from interface: Axis
      Sets the minimum range of this Axis.
      Specified by:
      min in interface Axis
      Parameters:
      sds - selectable dataset
      min - column in sds, where the minimum value is stored in row 0.
      Returns:
      this Axes
    • max

      public AxisImpl max(SelectableDataSet sds, String max)
      Description copied from interface: Axis
      Sets the maximum range of this Axis.
      Specified by:
      max in interface Axis
      Parameters:
      sds - selectable dataset
      max - column in sds, where the maximum value is stored in row 0.
      Returns:
      this Axes
    • ticksVisible

      public AxisImpl ticksVisible(boolean visible)
      Description copied from interface: Axis
      Sets whether ticks are drawn on this Axis.
      Specified by:
      ticksVisible in interface Axis
      Parameters:
      visible - whether ticks are drawn on this Axis
      Returns:
      this Axis
    • ticks

      public AxisImpl ticks(double gapBetweenTicks)
      Description copied from interface: Axis
      Sets the tick locations.
      Specified by:
      ticks in interface Axis
      Parameters:
      gapBetweenTicks - the distance between ticks. For example, if gapBetweenTicks is 5.0, and the first tick is at 10.0, the next will be drawn at 15.0.
      Returns:
      this Axis
    • ticks

      public AxisImpl ticks(double[] tickLocations)
      Description copied from interface: Axis
      Sets the tick locations.
      Specified by:
      ticks in interface Axis
      Parameters:
      tickLocations - coordinates of the major tick locations
      Returns:
      this Axis
    • minorTicksVisible

      public AxisImpl minorTicksVisible(boolean visible)
      Description copied from interface: Axis
      Sets whether minor ticks are drawn on this Axis.
      Specified by:
      minorTicksVisible in interface Axis
      Parameters:
      visible - whether minor ticks are drawn on this Axis
      Returns:
      this Axis
    • minorTicks

      public AxisImpl minorTicks(int nminor)
      Description copied from interface: Axis
      Sets the number of minor ticks between consecutive major ticks. These minor ticks are equally spaced.
      Specified by:
      minorTicks in interface Axis
      Parameters:
      nminor - number of minor ticks between consecutive major ticks.
      Returns:
      this Axis
    • tickLabelAngle

      public AxisImpl tickLabelAngle(double angle)
      Description copied from interface: Axis
      Sets the angle the tick labels of this Axis are drawn at.
      Specified by:
      tickLabelAngle in interface Axis
      Parameters:
      angle - angle in degrees
      Returns:
      this Axis