Class TypedDataset

  • All Implemented Interfaces:
    HasAnimation

    public class TypedDataset
    extends Object
    implements HasAnimation
    It contains the options to apply to all datasets of the chart.
    Author:
    Andrea "Stock" Stocchero
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AnimationContainer getAnimationContainer()
      Returns an animation container instance to use in the default methods of this interface.
      double getBarPercentage()
      Returns the percent (0-1) of the available width each bar should be within the category width.
      1.0 will take the whole category width and put the bars right next to each other.
      int getBarThickness()
      Returns the width of each bar in pixels.
      If set to 'flex', it computes "optimal" sample widths that globally arrange bars side by side.
      If not set, the base sample widths are calculated automatically so that they take the full available widths without overlap.
      Then, the bars are sized using barPercentage and categoryPercentage.
      double getCategoryPercentage()
      Returns the percent (0-1) of the available width each category should be within the sample width.
      IsChart getChart()
      Returns the chart instance
      protected ExtendedOptions getConfiguration()
      Returns the configuration element.
      int getMaxBarThickness()
      Returns the maximum bar thickness.
      int getMinBarLength()
      Returns a minimum length in pixels.
      protected ConfigurationOptions getOptions()
      Returns the configuration options.
      void setBarPercentage​(double barPercentage)
      Sets the percent (0-1) of the available width each bar should be within the category width.
      1.0 will take the whole category width and put the bars right next to each other.
      void setBarThickness​(int barThickness)
      Sets the width of each bar in pixels.
      If set to 'flex', it computes "optimal" sample widths that globally arrange bars side by side.
      If not set, the base sample widths are calculated automatically so that they take the full available widths without overlap.
      Then, the bars are sized using barPercentage and categoryPercentage.
      void setCategoryPercentage​(double categoryPercentage)
      Sets the percent (0-1) of the available width each category should be within the sample width.
      void setMaxBarThickness​(int maxBarThickness)
      Sets the maximum bar thickness, to ensure that bars are not sized thicker than this.
      void setMinBarLength​(int minBarLength)
      Set this to ensure that bars have a minimum length in pixels.
    • Method Detail

      • getAnimationContainer

        public final AnimationContainer getAnimationContainer()
        Description copied from interface: HasAnimation
        Returns an animation container instance to use in the default methods of this interface.
        Specified by:
        getAnimationContainer in interface HasAnimation
        Returns:
        an animation container instance
      • setBarPercentage

        public void setBarPercentage​(double barPercentage)
        Sets the percent (0-1) of the available width each bar should be within the category width.
        1.0 will take the whole category width and put the bars right next to each other.
        Parameters:
        barPercentage - percent (0-1) of the available width each bar should be within the category width.
        1.0 will take the whole category width and put the bars right next to each other.
      • getBarPercentage

        public double getBarPercentage()
        Returns the percent (0-1) of the available width each bar should be within the category width.
        1.0 will take the whole category width and put the bars right next to each other.
        Returns:
        percent (0-1) of the available width each bar should be within the category width.
        1.0 will take the whole category width and put the bars right next to each other.
      • setCategoryPercentage

        public void setCategoryPercentage​(double categoryPercentage)
        Sets the percent (0-1) of the available width each category should be within the sample width.
        Parameters:
        categoryPercentage - percent (0-1) of the available width each category should be within the sample width.
      • getCategoryPercentage

        public double getCategoryPercentage()
        Returns the percent (0-1) of the available width each category should be within the sample width.
        Returns:
        the percent (0-1) of the available width each category should be within the sample width.
      • setBarThickness

        public void setBarThickness​(int barThickness)
        Sets the width of each bar in pixels.
        If set to 'flex', it computes "optimal" sample widths that globally arrange bars side by side.
        If not set, the base sample widths are calculated automatically so that they take the full available widths without overlap.
        Then, the bars are sized using barPercentage and categoryPercentage.
        Parameters:
        barThickness - width of each bar in pixels.
        If not set, the base sample widths are calculated automatically so that they take the full available widths without overlap.
        Then, the bars are sized using barPercentage and categoryPercentage.
      • getBarThickness

        public int getBarThickness()
        Returns the width of each bar in pixels.
        If set to 'flex', it computes "optimal" sample widths that globally arrange bars side by side.
        If not set, the base sample widths are calculated automatically so that they take the full available widths without overlap.
        Then, the bars are sized using barPercentage and categoryPercentage.
        Returns:
        width of each bar in pixels.
        If not set, the base sample widths are calculated automatically so that they take the full available widths without overlap.
        Then, the bars are sized using barPercentage and categoryPercentage.
      • setMaxBarThickness

        public void setMaxBarThickness​(int maxBarThickness)
        Sets the maximum bar thickness, to ensure that bars are not sized thicker than this.
        Parameters:
        maxBarThickness - the maximum bar thickness.
      • getMaxBarThickness

        public int getMaxBarThickness()
        Returns the maximum bar thickness.
        Returns:
        the maximum bar thickness.
      • setMinBarLength

        public void setMinBarLength​(int minBarLength)
        Set this to ensure that bars have a minimum length in pixels.
        Parameters:
        minBarLength - a minimum length in pixels.
      • getMinBarLength

        public int getMinBarLength()
        Returns a minimum length in pixels.
        Returns:
        a minimum length in pixels.
      • getOptions

        protected final ConfigurationOptions getOptions()
        Returns the configuration options.
        Returns:
        the configuration options.
      • getConfiguration

        protected final ExtendedOptions getConfiguration()
        Returns the configuration element.
        Returns:
        the configuration element.
      • getChart

        public final IsChart getChart()
        Returns the chart instance
        Returns:
        the chart