Class Axis

java.lang.Object
org.jCharts.axisChart.axis.Axis
All Implemented Interfaces:
Serializable, HTMLTestable
Direct Known Subclasses:
DataAxis, LabelAxis, XAxis, YAxis

public abstract class Axis extends Object implements HTMLTestable, Serializable
See Also:
  • Field Details

    • axisChart

      private AxisChart axisChart
    • scalePixelWidth

      private float scalePixelWidth
    • pixelLength

      private float pixelLength
    • origin

      private float origin
    • titleHeight

      private float titleHeight
    • titleWidth

      private float titleWidth
    • minimumWidthNeeded

      private float minimumWidthNeeded
    • minimumHeightNeeded

      private float minimumHeightNeeded
    • axisLabelsGroup

      private TextTagGroup axisLabelsGroup
    • numberOfScaleItems

      private int numberOfScaleItems
    • tickStart

      private float tickStart
    • oneUnitPixelSize

      private double oneUnitPixelSize
    • zeroLineCoordinate

      private float zeroLineCoordinate
    • scaleCalculator

      private ScaleCalculator scaleCalculator
  • Constructor Details

    • Axis

      public Axis(AxisChart axisChart, int numberOfScaleItems)
      Constructor
      Parameters:
      axisChart -
      numberOfScaleItems -
  • Method Details

    • getAxisChart

      public final AxisChart getAxisChart()
      Returns reference to AxisChart Object.
      Returns:
      axisChart
    • getNumberOfScaleItems

      public int getNumberOfScaleItems()
    • getAxisLabelsGroup

      public TextTagGroup getAxisLabelsGroup()
    • setAxisLabelsGroup

      public void setAxisLabelsGroup(TextTagGroup axisLabelsGroup)
    • getTitleWidth

      public final float getTitleWidth()
    • getTitleHeight

      public final float getTitleHeight()
    • getPixelLength

      public final float getPixelLength()
    • setPixelLength

      public final void setPixelLength(float pixelLength)
    • getOrigin

      public final float getOrigin()
    • setOrigin

      public final void setOrigin(float origin)
    • getMinimumWidthNeeded

      public final float getMinimumWidthNeeded()
    • setMinimumWidthNeeded

      public final void setMinimumWidthNeeded(float minimumWidthNeeded)
    • getMinimumHeightNeeded

      public final float getMinimumHeightNeeded()
    • setMinimumHeightNeeded

      public final void setMinimumHeightNeeded(float minimumHeightNeeded)
    • getScalePixelWidth

      public final float getScalePixelWidth()
    • setScalePixelWidth

      public final void setScalePixelWidth(float scalePixelWidth)
    • getTickStart

      public float getTickStart()
    • setTickStart

      public void setTickStart(float tickStart)
    • getScaleCalculator

      public ScaleCalculator getScaleCalculator()
    • setScaleCalculator

      public void setScaleCalculator(ScaleCalculator scaleCalculator)
    • computeAxisTitleDimensions

      public final void computeAxisTitleDimensions(String title, ChartFont axisTitleFont)
      Parameters:
      title -
      axisTitleFont -
    • toHTML

      public void toHTML(HTMLGenerator htmlGenerator)
      Enables the testing routines to display the contents of this Object. Can only see 'private' fields from this class.
      Specified by:
      toHTML in interface HTMLTestable
      Parameters:
      htmlGenerator -
    • computeScalePixelWidth

      public void computeScalePixelWidth()
      Computes the number of pixels between each value on the axis.
    • computeScalePixelWidthDataAxis

      public void computeScalePixelWidthDataAxis()
      Computes the number of pixels between each value on the axis.
    • setOneUnitPixelSize

      public void setOneUnitPixelSize(double oneUnitPixelSize)
    • getOneUnitPixelSize

      public double getOneUnitPixelSize()
      Returns the number of pixels one value unit occupies.
      Returns:
      double the number of pixels one value unit occupies.
    • getZeroLineCoordinate

      public float getZeroLineCoordinate()
      Returns the screen coordinate of the zero line. This will not always be the same as the origin as not all charts start at zero. This is needed not only by the Axis, but some of the Chart implementations as well.
      Returns:
      float the screen pixel location of the zero line.
    • setZeroLineCoordinate

      public void setZeroLineCoordinate(float value)
      Sets the screen coordinate of the zero line. This will not always be the same as the origin as not all charts start at zero.
      Parameters:
      value - the screen pixel location of the zero line.
    • computeOneUnitPixelSize

      public void computeOneUnitPixelSize(float scalePixelLength, double increment)
      Computes the relationship of data point values to pixel values so know where along the axis a value is.
      Parameters:
      scalePixelLength -
      increment -