Documentation of 'kcl.waterloo.graphics.plots2D.GJBar' Java class
GJBar
kcl.waterloo.graphics.plots2D

Class GJBar

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener, GJEffectorInterface, GJFastPlotInterface, GJPlotInterface, GJLinkableInterface, GJObservableInterface, GJDataModelInterface<java.awt.geom.Rectangle2D,GJGraphInterface>, GJFillableInterface<java.awt.Shape,java.awt.Paint>, GJScreenDataInterface<java.awt.Shape>, GJVisualsInterface<GJMarker,java.awt.Paint,java.awt.BasicStroke,java.awt.Dimension,java.awt.Shape>


    public class GJBar
    extends GJAbstractPlot
    GJBar supports bar plots and histograms. GJBar is unusual in supporting swapping of data displayed along the x- and y-axes to support both vertical and horizontal bar charts.
    • For vertical bars.
      • The XData represent the offsets on the x-axis.
      • the YData represent their heights.
    • For horizontal bars.
      • The XData represent the offsets on the y-axis.
      • the YData represent their horizontal lengths.
    This support is limited to the display of the bars through the x,y data pairs. If you want e.g. to add categories to an axis, you need to address those calls to the axis appropriate to the alignment so with horizontal bars, you should still call getYData().setCategory(...). However, the behaviour of the getDataRange() has been overridden to account for the alignment (which facilitates auto ranging of the axes).
    • Method Detail

      • createInstance

        public static GJPlotInterface createInstance()
        Factory method for creating a bar chart.
        Returns:
        the GJBar instance
      • paintPlot

        public final void paintPlot(java.awt.Graphics2D g2)
        Description copied from class: GJAbstractPlot
        Note that this method is overloaded by all concrete sub-classes which should call this super-class method.
        Specified by:
        paintPlot in interface GJPlotInterface
        Overrides:
        paintPlot in class GJAbstractPlot
      • getDataRange

        public final java.awt.geom.Rectangle2D getDataRange()
        This overrides the super class method providing support for horizontal bars too by swapping the x- and y- data. The behaviour of other methods that call getDataRange will change as a consequence.
        Specified by:
        getDataRange in interface GJDataModelInterface<java.awt.geom.Rectangle2D,GJGraphInterface>
        Overrides:
        getDataRange in class GJAbstractPlot
        Returns:

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.