Class SeriesBasedChart<T>

java.lang.Object
com.jbstrap.ui.components.charts.BaseChart<T>
com.jbstrap.ui.components.charts.SeriesBasedChart<T>
All Implemented Interfaces:
DataDescriptorCallback
Direct Known Subclasses:
AxesBasedChart, DonutChart, FunnelChart, GaugeChart, PieChart

public abstract class SeriesBasedChart<T> extends BaseChart<T> implements DataDescriptorCallback
  • Field Details

    • dataDescriptor

      protected DataDescriptor dataDescriptor
    • categoryColumn

      protected String categoryColumn
    • series

      protected final Map<String,Series> series
    • defaultFilterCriteria

      protected Criteria defaultFilterCriteria
    • filterCriteria

      protected Criteria filterCriteria
  • Constructor Details

    • SeriesBasedChart

      protected SeriesBasedChart(String name, TooltipType defaultTooltipType, com.google.common.collect.ImmutableList<TooltipType> supportedTooltipTypes)
  • Method Details

    • setDataDescriptor

      public void setDataDescriptor(DataDescriptor dataDescriptor, String categoryColumnName)
    • getDataDescriptor

      public DataDescriptor getDataDescriptor()
      Gets the chart’s DataDescriptor.
      Returns:
      Chart DataDescriptor If the chart does not use a DataDescriptor, the method returns null.
    • getCategoryColumnName

      public String getCategoryColumnName()
      Gets the DataDescriptor column name containing chart categories (X axis values).
      Returns:
      Chart category column name If the chart does not use a DataDescriptor, the method returns null.
    • _addSeries

      protected T _addSeries(Series series)
    • removeSeries

      public T removeSeries(String title)
      Parameters:
      title - Data series title
      Returns:
      Chart instance
    • setDefaultFilterCriteria

      public T setDefaultFilterCriteria(Criteria defaultFilterCriteria)
      Sets the default filter criterion used for filtering chart data. The filter criterion specified here is concatenated with an ‘AND’ operator to the criterion specified. and then used in the query.
      Parameters:
      defaultFilterCriteria - Default filter criterion If null is specified, the default filter criterion is ignored during the query.
      Returns:
      Chart instance
    • getDefaultFilterCriteria

      public Criteria getDefaultFilterCriteria()
      Gets the default filter criterion.
      Returns:
      Default filter criterion, or null there is no default filter criterion specified for the chart
    • setFilterCriteria

      public T setFilterCriteria(Criteria criteria)
      Sets the chart’s filter criterion. The filter criterion specified here is concatenated with an ‘AND’ operator to the criterion specified method.
      Parameters:
      criteria - Filter criterion If null is specified, the filter criteria are ignored during the query.
      Returns:
      Chart instance
    • getFilterCriteria

      public Criteria getFilterCriteria()
      Gets the filter criterion used for filtering the chart data.
      Returns:
      Filter criterion, or null, if no filter criterion is set
    • fetchData

      public T fetchData()
    • clear

      public T clear()
    • onSuccess

      public void onSuccess(List<Record> data)
      Description copied from interface: DataDescriptorCallback
      The method is invoked, if the async data handling operation was successful.
      Specified by:
      onSuccess in interface DataDescriptorCallback
      Parameters:
      data - The list of records that are returned. In the cause of a query, the query results. In the case of a save, the saved records.
    • onError

      public void onError(Throwable e)
      Description copied from interface: DataDescriptorCallback
      The method is invoked, if an error was encountered during the async operation
      Specified by:
      onError in interface DataDescriptorCallback
      Parameters:
      e - The encountered error/exception
    • registerDataColumn

      protected T registerDataColumn(String title, String dataColumnName)
    • _getSeriesNames

      protected List<String> _getSeriesNames()
    • getDataColumnBySeriesName

      protected String getDataColumnBySeriesName(String title)
    • _getSeries

      protected Series _getSeries(String title)
    • refreshData

      protected T refreshData()
      Description copied from class: BaseChart
      Updates the chart data.
      Overrides:
      refreshData in class BaseChart<T>
      Returns:
      Chart
    • generateJSON

      protected String generateJSON()
      Description copied from class: BaseChart
      Generates a JSON object containing the chart settings.
      Overrides:
      generateJSON in class BaseChart<T>
      Returns:
      JSON object containing the chart settings