Documentation of 'de.erichseifert.gral.plots.BarPlot' Java class
BarPlot
de.erichseifert.gral.plots

Class BarPlot

  • All Implemented Interfaces:
    DataListener, Container, Drawable, Navigable, AxisListener, Plot, java.io.Serializable, java.lang.Iterable<Drawable>


    public class BarPlot
    extends XYPlot

    Class that displays data in a bar plot.

    To create a new BarPlot simply create a new instance using one or more data sources. Example:

     DataTable data = new DataTable(Integer.class, Double.class);
     data.add(2010, -5.00);
     data.add(2011,  3.25);
     data.add(2012, -0.50);
     data.add(2012,  4.00);
    
     BarPlot plot = new BarPlot(data);
     
    See Also:
    Serialized Form
    • Constructor Detail

      • BarPlot

        public BarPlot(DataSource... data)
        Creates a new instance and initializes it with the specified data sources.
        Parameters:
        data - Data to be displayed.
    • Method Detail

      • autoscaleAxis

        public void autoscaleAxis(java.lang.String axisName)
        Description copied from class: AbstractPlot
        Tries to automatically set the ranges of the axes specified by the name if it is set to auto-scale.
        Specified by:
        autoscaleAxis in interface Plot
        Overrides:
        autoscaleAxis in class AbstractPlot
        Parameters:
        axisName - Name of the axis that should be scaled.
        See Also:
        Axis.setAutoscaled(boolean)
      • add

        public void add(int index,
                        DataSource source,
                        boolean visible)
        Description copied from class: AbstractPlot
        Inserts the specified data series to the plot at a specified position.
        Specified by:
        add in interface Plot
        Overrides:
        add in class XYPlot
        Parameters:
        index - Position.
        source - Data series.
        visible - true if the series should be displayed, false otherwise.
      • getBarWidth

        public double getBarWidth()
        Returns the width of the bars in axis coordinates.
        Returns:
        Width of the bars in axis coordinates.
      • setBarWidth

        public void setBarWidth(double barWidth)
        Sets the width of the bars in axis coordinates.
        Parameters:
        barWidth - Width of the bars in axis coordinates.
      • getBarHeightMin

        public double getBarHeightMin()
        Returns the minimum height of the bars in view units (e.g. pixels on screen).
        Returns:
        Minimum height of the bars in view units.
      • setBarHeightMin

        public void setBarHeightMin(double barHeightMin)
        Sets the minimum height of the bars in view units (e.g. pixels on screen).
        Parameters:
        barHeightMin - Minimum height of the bars in view units.
      • isPaintAllBars

        public boolean isPaintAllBars()
        Returns whether all bars are filled as a whole, or if each bar is filled independently.
        Returns:
        true if all bars are filled as a whole, or false if each bar is filled independently.
      • setPaintAllBars

        public void setPaintAllBars(boolean paintAllBars)
        Sets whether all bars will be filled as a whole, or if each bar will be filled independently.
        Parameters:
        paintAllBars - true to fill all bars as a whole, or false to fill each bar independently.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.