Interface IAbstractBarVisualSet<T,C>

Type Parameters:
T - visual set data elements type
C - data categories type
All Known Implementing Classes:
BarVisualSet, HistogramVisualSet, WaterfallVisualSet

public interface IAbstractBarVisualSet<T,C>
Interface that is the parent for all visual sets with rectangle-visuals corresponding to the statistical data by categories as well as histograms.
Author:
Aleksey Kirillov
  • Method Details

    • setBackgroundColor

      IAbstractBarVisualSet<T,C> setBackgroundColor(Function<C,Color> backgroundColorExtractor)
      Sets the background color for each category. The color may be different for different categories and it does not depend on different data elements. Also used to display a color icon in the Legend.
      Parameters:
      backgroundColorExtractor - the background color extractor, i.e. method returning color depending on the category
      Returns:
      reference to this object
    • setBorderColor

      IAbstractBarVisualSet<T,C> setBorderColor(Function<C,Color> borderColorExtractor)
      Sets the border color for each category. The color may be different for different categories and it does not depend on different data elements.
      Parameters:
      borderColorExtractor - the border color extractor, i.e. method returning color depending on the category
      Returns:
      reference to this object
    • setBorderWidth

      IAbstractBarVisualSet<T,C> setBorderWidth(Function<C,Double> borderWidthExtractor)
      Sets the border width in pixels for each category. The width may be different for different categories and it does not depend on different data elements.
      Parameters:
      borderWidthExtractor - the border width extractor, i.e. method returning the width depending on the category
      Returns:
      reference to this object
    • getBackgroundColor

      Color getBackgroundColor(C category)
      Returns the background color for given category.
      Parameters:
      category - category for which the background color is being checked
      Returns:
      the background color for given category
    • getBorderColor

      Color getBorderColor(C category)
      Returns the border color for given category.
      Parameters:
      category - category for which the border color is being checked
      Returns:
      the border color for given category
    • getBorderWidth

      double getBorderWidth(C category)
      Returns the border width in pixels for given category.
      Parameters:
      category - category for which the border width in pixels is being checked
      Returns:
      the border width in pixels for given category
    • setLegendLabelText

      IAbstractBarVisualSet<T,C> setLegendLabelText(Function<C,String> legendLabelTextExtractor)
      Sets the legend label text for each category.
      Parameters:
      legendLabelTextExtractor - the legend label text extractor, i.e. method returning text depending on the category
      Returns:
      reference to this object
    • getLegendLabelText

      String getLegendLabelText(C category)
      Returns the legend label text for given category.
      Parameters:
      category - category for which the legend label text is being checked
      Returns:
      the legend label text for given category
    • setElementText

      IAbstractBarVisualSet<T,C> setElementText(Function<T,String> elementTextExtractor)
      Sets the label text for each data element. This label is displayed on the ticks of the X-axis, below the corresponding bars.
      Parameters:
      elementTextExtractor - the text of the bar label
      Returns:
      reference to this object
    • getElementText

      String getElementText(T element)
      Returns the label text for each data element.
      Parameters:
      element - data element for which the label text is being checked
      Returns:
      the label text for each data element
    • getColumnWidthFraction

      double getColumnWidthFraction()
      Returns the width fraction to region allocated for each individual category-bar.
      Returns:
      the width fraction to region allocated for each individual category-bar
    • getCategories

      List<C> getCategories()
      Returns the list of data categories.
      Returns:
      the list of data categories
    • getMinArgument

      double getMinArgument()
      Returns the minimum possible value that stored in the current data elements list.
      Returns:
      the minimum possible value that stored in the current data elements list
    • getMaxArgument

      double getMaxArgument()
      Returns the maximum possible value that stored in the current data elements list.
      Returns:
      the maximum possible value that stored in the current data elements list
    • getPercentOfMaxValue

      double getPercentOfMaxValue()
      Returns the ratio of the value for the maximum group to the total sum of the all values across the entire statistics.
      Returns:
      the ratio of the value for the maximum group to the total sum of the all values across the entire statistics
    • getPercentOfMaxValue

      double getPercentOfMaxValue(Predicate<C> categoryPredicate)
      Returns the ratio of the value for the maximum group to the total sum of the all values across the entire statistics.

      Considers only the categories filtered by the corresponding predicate.

      Parameters:
      categoryPredicate - filter for categories for which the ratio is calculated
      Returns:
      the ratio of the value for the maximum group to the total sum of the all values across the entire statistics
    • getMaxGroupValue

      double getMaxGroupValue()
      Returns the maximum value for any data group within all existed data elements. The data group in the case of a histogram is the range of the X-axis arguments, and in the case of a bar chart, each individual data element.
      Returns:
      the maximum value for any data group within all existed data elements
    • getMaxGroupValue

      double getMaxGroupValue(Predicate<C> categoryPredicate)
      Returns the maximum value for any data group within all existed data elements.

      The data group in the case of a histogram is the range of the X-axis arguments, and in the case of a bar chart, each individual data element.

      Considers only the categories filtered by the corresponding predicate.

      Parameters:
      categoryPredicate - filter for categories for which the maximum value is calculated
      Returns:
      the maximum value for any data group within all existed data elements
    • getMaxValueByAnyCategory

      double getMaxValueByAnyCategory()
      Returns the maximum value for any category within all existed data elements.
      Returns:
      the maximum value for any category within all existed data elements
    • getMaxValueByAnyCategory

      double getMaxValueByAnyCategory(Predicate<C> categoryPredicate)
      Returns the maximum value between given filtered categories within all existed data elements.
      Parameters:
      categoryPredicate - filter for categories for which the maximum value is calculated
      Returns:
      the maximum value between given filtered categories within all existed data elements
    • getValue

      double getValue(T element, C category)
      Returns the value for given category within the given data element.
      Parameters:
      element - data element for which the total value is being checked
      category - category for which the total value is being checked
      Returns:
      the value for given category within the given data element
    • getSummaryValue

      double getSummaryValue(T element)
      Returns the total value for all categories within the given data element.
      Parameters:
      element - data element for which the total value is being checked
      Returns:
      the total value for all categories within the given date element
    • getSummaryValue

      double getSummaryValue(T element, Predicate<C> categoryPredicate)
      Returns the total value for specified categories within the specified data element.
      Parameters:
      element - data element for which the total value is being checked
      categoryPredicate - filter for categories for which the amount is calculated
      Returns:
      the total value for specified categories within the specified data element
    • getVisualElements

      List<? extends VisualSet<?>.VisualElement> getVisualElements(boolean recalculationRequired)
      Returns the list of visual elements corresponding to current data elements. Cannot be changed by the user.
      Parameters:
      recalculationRequired - flag of the need to recalculate the visual elements
      Returns:
      the list of visual elements corresponding to current data elements