Class Histogram

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, SizeOfHandler, ColorProviderHandler, Serializable

    public class Histogram
    extends AbstractChartGenerator
    implements ColorProviderHandler
    Generates histograms by plotting the X column against the Y column.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -width <int> (property: width)
        The width of the chart dialog.
        default: 800
        minimum: -1
     
    -height <int> (property: height)
        The height of the chart dialog.
        default: 600
        minimum: -1
     
    -row-finder <adams.data.spreadsheet.rowfinder.RowFinder> (property: rowFinder)
        The row finder to use for restricting the rows used for the chart.
        default: adams.data.spreadsheet.rowfinder.ByIndex
     
    -selection <ROW|COLUMN> (property: selection)
        The type of data to use as basis for the histogram
        default: COLUMN
     
    -rows <java.lang.String> (property: rows)
        The range of rows to use for the histogram, if the selection is ROW; A range 
        is a comma-separated list of single 1-based indices or sub-ranges of indices 
        ('start-end'); 'inv(...)' inverts the range '...'; the following placeholders 
        can be used as well: first, second, third, last_2, last_1, last
        default: 
     
    -columns <java.lang.String> (property: columns)
        The range of columns to use for the histogram, if selection is COLUMN; A 
        range is a comma-separated list of single 1-based indices or sub-ranges 
        of indices ('start-end'); 'inv(...)' inverts the range '...'; column names 
        (case-sensitive) as well as the following placeholders can be used: first,
         second, third, last_2, last_1, last
        default: 
     
    -histogram <adams.data.statistics.ArrayHistogram> (property: histogram)
        The histogram setup to use.
        default: adams.data.statistics.ArrayHistogram
     
    -color-provider <adams.gui.visualization.core.ColorProvider> (property: colorProvider)
        The color provider to use.
        default: adams.gui.visualization.core.DefaultColorProvider
     
    -bar-width <int> (property: barWidth)
        The width of the bar in pixel.
        default: 10
        minimum: 1
     
    -offset <int> (property: offset)
        The offset in pixel for multiple plots.
        default: 3
        minimum: 0
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Rows

        protected Range m_Rows
        the range of rows to use.
      • m_Histogram

        protected ArrayHistogram m_Histogram
        the histogram setup.
      • m_ColorProvider

        protected ColorProvider m_ColorProvider
        the color provider to use.
      • m_BarWidth

        protected int m_BarWidth
        the width of the bar.
      • m_Offset

        protected int m_Offset
        the offset in case of multiple plots.
    • Constructor Detail

      • Histogram

        public Histogram()
    • Method Detail

      • setSelection

        public void setSelection​(Histogram.Selection value)
        Sets what data to use as basis for the histogram.
        Parameters:
        value - the selection
      • getSelection

        public Histogram.Selection getSelection()
        Returns what data to use as basis for the histogram.
        Returns:
        the selection
      • selectionTipText

        public String selectionTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • rowsTipText

        public String rowsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • columnsTipText

        public String columnsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setHistogram

        public void setHistogram​(ArrayHistogram value)
        Sets the histogram setup to use.
        Parameters:
        value - the histogram
      • getHistogram

        public ArrayHistogram getHistogram()
        Returns the histogram setup to use.
        Returns:
        the histogram
      • histogramTipText

        public String histogramTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • colorProviderTipText

        public String colorProviderTipText()
        Returns the tip text for this property.
        Specified by:
        colorProviderTipText in interface ColorProviderHandler
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setBarWidth

        public void setBarWidth​(int value)
        Sets the width of the bar.
        Parameters:
        value - width in pixel
      • getBarWidth

        public int getBarWidth()
        Returns the width of the bar.
        Returns:
        width in pixel
      • barWidthTipText

        public String barWidthTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setOffset

        public void setOffset​(int value)
        Sets the offset for multiple plots.
        Parameters:
        value - offset in pixel
      • getOffset

        public int getOffset()
        Returns the offset for multiple plots.
        Returns:
        offset in pixel
      • offsetTipText

        public String offsetTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • addChartGeneration

        protected void addChartGeneration​(Flow flow,
                                          String name,
                                          SpreadSheet sheet)
        Adds the chart generation to the flow. The flow already contains forwarding of spreadsheet and selecting subset of rows.
        Specified by:
        addChartGeneration in class AbstractChartGenerator
        Parameters:
        flow - the flow to extend
        name - the name of the tab/sheet
        sheet - the spreadsheet to generate the flow for