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
FieldsModifier and TypeFieldDescriptionprotected Stringprotected DataDescriptorprotected Criteriaprotected CriteriaFields inherited from class com.jbstrap.ui.components.charts.BaseChart
brushable, canvas, defaultTooltipType, handlers, NAME, params, supportedTooltipTypes, tooltipContent, tooltipType, zoomable -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSeriesBasedChart(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 StringGenerates a JSON object containing the chart settings.Gets the DataDescriptor column name containing chart categories (X axis values).protected StringgetDataColumnBySeriesName(String title) Gets the chart’s DataDescriptor.Gets the default filter criterion.Gets the filter criterion used for filtering the chart data.voidThe method is invoked, if an error was encountered during the async operationvoidThe method is invoked, if the async data handling operation was successful.protected TUpdates the chart data.protected TregisterDataColumn(String title, String dataColumnName) removeSeries(String title) voidsetDataDescriptor(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 Ifnullis specified, the default filter criterion is ignored during the query.- Returns:
- Chart instance
-
getDefaultFilterCriteria
Gets the default filter criterion.- Returns:
- Default filter criterion, or
nullthere 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 Ifnullis 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:DataDescriptorCallbackThe method is invoked, if the async data handling operation was successful.- Specified by:
onSuccessin 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:DataDescriptorCallbackThe method is invoked, if an error was encountered during the async operation- Specified by:
onErrorin interfaceDataDescriptorCallback- Parameters:
e- The encountered error/exception
-
registerDataColumn
-
_getSeriesNames
-
getDataColumnBySeriesName
-
_getSeries
-
refreshData
Description copied from class:BaseChartUpdates the chart data.- Overrides:
refreshDatain classBaseChart<T>- Returns:
- Chart
-
generateJSON
Description copied from class:BaseChartGenerates a JSON object containing the chart settings.- Overrides:
generateJSONin classBaseChart<T>- Returns:
- JSON object containing the chart settings
-