Class AbstractBarGraph

    • Field Detail

      • barwidth

        protected double barwidth
      • bardepth

        protected double bardepth
      • xkey

        protected org.faceless.graph.Key xkey
      • ykey

        protected org.faceless.graph.Key ykey
      • zkey

        protected org.faceless.graph.Key zkey
      • minx

        protected double minx
      • maxx

        protected double maxx
      • minz

        protected double minz
      • maxz

        protected double maxz
      • maxv

        protected double maxv
      • minv

        protected double minv
      • displayvalue

        protected int displayvalue
      • roundbars

        protected boolean roundbars
    • Constructor Detail

      • AbstractBarGraph

        protected AbstractBarGraph()
    • Method Detail

      • optionBarWidth

        public void optionBarWidth​(double val)
        How wide to make each bar, as a proportion of the square it rests on

        Default: 1.0

      • optionBarDepth

        public void optionBarDepth​(double val)
        How deep to make each bar, as a proportion of the square it rests on

        Default: 1.0

      • optionDisplayValue

        public void optionDisplayValue​(int pos)
        Whether to display the value for the bar directly on the graph. One of DISPLAYVALUE_NONE to not display the value, DISPLAYVALUE_MIDDLE to display the value in the middle of the bar, DISPLAYVALUE_TOP to display the value above the bar, or DISPLAYVALUE_INSIDETOP to display the value at the end of but just inside the bar.

        Default: DISPLAYVALUE_NONE

        Since:
        1.0.7
      • optionRoundBars

        public void optionRoundBars​(boolean round)

        Whether to draw the bars in the graph as cylinders instead of the default rectangles. The diameter of the cylinder is the average of the bar-depth and the bar-width. This value may be ignored by some subclasses (currently only MultiBarGraph).

        Drawing cylinders is considerably slower than drawing rectangles. This can be sped up by reducing the number of flat edges used to draw the cylinder, by passing a higher value to the Graph.setPieEdgeDegrees(double) method. The default for Bar Graphs is 10.

        Since:
        1.0.10
      • optionXStretchToZero

        public void optionXStretchToZero​(boolean val)
        Cannot be set by the user for this class and it's subclasses. Will always throw an exception.
        Overrides:
        optionXStretchToZero in class AxesGraph
        Throws:
        java.lang.UnsupportedOperationException
      • optionYStretchToZero

        public void optionYStretchToZero​(boolean val)
        Cannot be set by the user for this class and it's subclasses. Will always throw an exception.
        Overrides:
        optionYStretchToZero in class AxesGraph
        Throws:
        java.lang.UnsupportedOperationException
      • complete

        protected void complete()
        This method takes care of most of the work to plot BarGraphs. It cycles through all the data values and calls plotBar to actually draw the data.
        Overrides:
        complete in class Graph
      • postcomplete

        protected void postcomplete()
        Description copied from class: Graph
        PostComplete is called by a Graph when it's rendered, but after complete. It should add any elements that are required but couldn't be calculated until after Graph.complete() (the axes in an axes graph are an example). The last thing it should do before returning is call super.postcomplete()
        Overrides:
        postcomplete in class AxesGraph
      • plotBar

        protected abstract void plotBar​(int ix,
                                        int iy,
                                        int iz,
                                        double val)
        Needs to be completed by concrete subclasses of this class.
        Parameters:
        ix - The X position of this value
        iy - The Y position of this value
        iz - The Z position of this value
        val - The value to plot.
      • plotBarValue

        protected void plotBarValue​(Point p1,
                                    Point p2,
                                    double val)
      • getBoxElement

        protected org.faceless.graph.Element getBoxElement​(java.lang.String name,
                                                           Point p1,
                                                           Point p2,
                                                           Style style)