Package com.jbstrap.ui.components.charts
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
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected DataDescriptor
protected Criteria
protected Criteria
Fields inherited from class com.jbstrap.ui.components.charts.BaseChart
brushable, canvas, defaultTooltipType, handlers, NAME, params, supportedTooltipTypes, tooltipContent, tooltipType, zoomable
-
Constructor Summary
ModifierConstructorDescriptionprotected
SeriesBasedChart
(String name, TooltipType defaultTooltipType, com.google.common.collect.ImmutableList<TooltipType> supportedTooltipTypes) -
Method Summary
Modifier and TypeMethodDescriptionprotected T
_addSeries
(Series series) protected Series
_getSeries
(String title) clear()
protected String
Generates a JSON object containing the chart settings.Gets the DataDescriptor column name containing chart categories (X axis values).protected String
getDataColumnBySeriesName
(String title) Gets the chart’s DataDescriptor.Gets the default filter criterion.Gets the filter criterion used for filtering the chart data.void
The method is invoked, if an error was encountered during the async operationvoid
The method is invoked, if the async data handling operation was successful.protected T
Updates the chart data.protected T
registerDataColumn
(String title, String dataColumnName) removeSeries
(String title) void
setDataDescriptor
(DataDescriptor dataDescriptor, String categoryColumnName) setDefaultFilterCriteria
(Criteria defaultFilterCriteria) Sets the default filter criterion used for filtering chart data.setFilterCriteria
(Criteria criteria) Sets the chart’s filter criterion.Methods inherited from class com.jbstrap.ui.components.charts.BaseChart
getCanvas, getDefaultTooltipType, getHandlers, getName, getSupportedTooltipTypes, init, runJs, setParent
-
Field Details
-
dataDescriptor
-
categoryColumn
-
series
-
defaultFilterCriteria
-
filterCriteria
-
-
Constructor Details
-
SeriesBasedChart
protected SeriesBasedChart(String name, TooltipType defaultTooltipType, com.google.common.collect.ImmutableList<TooltipType> supportedTooltipTypes)
-
-
Method Details
-
setDataDescriptor
-
getDataDescriptor
Gets the chart’s DataDescriptor.- Returns:
- Chart DataDescriptor If the chart does not use a DataDescriptor, the method returns
null
.
-
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
-
removeSeries
- Parameters:
title
- Data series title- Returns:
- Chart instance
-
setDefaultFilterCriteria
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 Ifnull
is specified, the default filter criterion is ignored during the query.- Returns:
- Chart instance
-
getDefaultFilterCriteria
Gets the default filter criterion.- Returns:
- Default filter criterion, or
null
there is no default filter criterion specified for the chart
-
setFilterCriteria
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 Ifnull
is specified, the filter criteria are ignored during the query.- Returns:
- Chart instance
-
getFilterCriteria
Gets the filter criterion used for filtering the chart data.- Returns:
- Filter criterion, or
null
, if no filter criterion is set
-
fetchData
-
clear
-
onSuccess
Description copied from interface:DataDescriptorCallback
The method is invoked, if the async data handling operation was successful.- Specified by:
onSuccess
in interfaceDataDescriptorCallback
- 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
Description copied from interface:DataDescriptorCallback
The method is invoked, if an error was encountered during the async operation- Specified by:
onError
in interfaceDataDescriptorCallback
- Parameters:
e
- The encountered error/exception
-
registerDataColumn
-
_getSeriesNames
-
getDataColumnBySeriesName
-
_getSeries
-
refreshData
Description copied from class:BaseChart
Updates the chart data.- Overrides:
refreshData
in classBaseChart<T>
- Returns:
- Chart
-
generateJSON
Description copied from class:BaseChart
Generates a JSON object containing the chart settings.- Overrides:
generateJSON
in classBaseChart<T>
- Returns:
- JSON object containing the chart settings
-