Class LevelRenderer

    • Constructor Detail

      • LevelRenderer

        public LevelRenderer()
        Creates a new renderer with default settings.
    • Method Detail

      • setItemMargin

        public void setItemMargin​(double percent)
        Sets the item margin and sends a RendererChangeEvent to all registered listeners. The value is expressed as a percentage of the available width for plotting all the bars, with the resulting amount to be distributed between all the bars evenly.
        Parameters:
        percent - the new margin.
        See Also:
        getItemMargin()
      • setMaximumItemWidth

        public void setMaximumItemWidth​(double percent)
        Sets the maximum item width, which is specified as a percentage of the available space for all items, and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        percent - the percent.
        See Also:
        getMaximumItemWidth()
      • calculateItemWidth

        protected void calculateItemWidth​(CategoryPlot plot,
                                          Rectangle2D dataArea,
                                          int rendererIndex,
                                          CategoryItemRendererState state)
        Calculates the bar width and stores it in the renderer state.
        Parameters:
        plot - the plot.
        dataArea - the data area.
        rendererIndex - the renderer index.
        state - the renderer state.
      • calculateBarW0

        protected double calculateBarW0​(CategoryPlot plot,
                                        PlotOrientation orientation,
                                        Rectangle2D dataArea,
                                        CategoryAxis domainAxis,
                                        CategoryItemRendererState state,
                                        int row,
                                        int column)
        Calculates the coordinate of the first "side" of a bar. This will be the minimum x-coordinate for a vertical bar, and the minimum y-coordinate for a horizontal bar.
        Parameters:
        plot - the plot.
        orientation - the plot orientation.
        dataArea - the data area.
        domainAxis - the domain axis.
        state - the renderer state (has the bar width precalculated).
        row - the row index.
        column - the column index.
        Returns:
        The coordinate.
      • calculateSeriesWidth

        protected double calculateSeriesWidth​(double space,
                                              CategoryAxis axis,
                                              int categories,
                                              int series)
        Calculates the available space for each series.
        Parameters:
        space - the space along the entire axis (in Java2D units).
        axis - the category axis.
        categories - the number of categories.
        series - the number of series.
        Returns:
        The width of one series.