Class Sparkline
- All Implemented Interfaces:
Animatable<Sparkline>
,CanDrop<Sparkline>
,Clickable<Sparkline>
,Draggable<Sparkline>
,Fetchable<Sparkline>
,HandleMouseEvents<Sparkline>
,BasedOnDataDescriptor<Sparkline>
,Touchable<Sparkline>
Sparkline component
The sparkline component is a simplified chart component. Use the sparkline component to visualize numeric data on a chart. These charts can later be reused as a list grid column or dashboard panel.
The component is not intended to visualize complex or large-scale charts and has a limited range of settings. The component’s main purpose is to to provide an overview of a large amount of data or to visualize trends.Supported events:
AnimationStart
AnimationEnd
,
Click
,
DoubleClick
,
MouseDown
,
MouseDown
,
MouseLeave
,
MouseMove
,
MouseOver
,
MouseOut
,
MouseUp
,
Wheel
,
TouchCancel
,
TouchEnd
,
TouchMove
,
TouchStart
,
Drop
,
DragStart
,
DragEnd
- Since:
- 4.0
- Author:
- JBStrap
-
Field Summary
Fields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
-
Constructor Summary
ConstructorDescriptionCreates a simple line chart.Sparkline
(DataDescriptorColumn dsColumn) Creates a chart based on the specified DataDescriptor column.Sparkline
(DataDescriptorColumn dsColumn, String language) Creates a chart based on the specified DataDescriptor column according to the language code.Sparkline
(SparklineType type) Creates a chart with the specified type.Sparkline
(SparklineType type, List<Number> value) Creates a chart with the specified type and dataCreates a simple line chart according to the specified language code.Sparkline
(String language, SparklineType type) Creates a chart with the specified type according to the language code.Sparkline
(String language, SparklineType type, List<Number> value) Creates a chart with the specified type and data according to the language code.Creates a simple line chart according to the specified language code.Creates a chart with the specified type and data according to the language code.Creates a simple line chart based on the specified data according to the language code.Creates a simple line chart based on the specified data. -
Method Summary
Modifier and TypeMethodDescriptionaddComponent
(Component<?> component) Adds another sparkline component to the current one.addComponents
(Component<?>... components) Adds multiple sparkline components to the current one.Deletes sparkline component values.This method implements actual data retrieval.Queries data from the database.Gets the chart’s maximum value.Gets the chart’s minimum value.getColor()
Gets chart color.Gets the DataDescriptor column for the component value.Gets the column name containing the displayed values.Gets the sparkline DataDescriptor.Gets the filter criterion used for the query.Gets the component height.Gets the DataDescriptor column name referencing the data set to be displayed.Gets the color of the negative values on the chart.Sets the data column name.Gets the tooltip header text.Gets tooltip format.Gets the prefix in the tooltip value.Gets tooltip value suffix.getType()
Gets the displayed chart type.getValue()
Gets the displayed values.getWidth()
Gets the component’s width.void
init()
The component initialization method.boolean
Checks if data query is automatically performed.boolean
Checks if the component is a composite sparkline component.void
onShow()
The operations to be executed after the component is displayed on the clientredraw()
Redraws the component on the interface.removeComponent
(Component<?> component) Removes a sparkline component from the current one.removeComponents
(Component<?>... components) Removes multiple sparkline components from the current one.setAutoFetchData
(boolean autoFetch) Sets if the component automatically queries the data from the database upon being displayed.setChartRangeMax
(Integer chartRangeMax) Sets the maximum value for the chart.setChartRangeMin
(Integer chartRangeMin) Sets the minimum value for the chart.Sets chart color.setCustomFetch
(FetchEvent fetchEvent) Sets a custom query.setDataColumn
(String dataColumn) Sets the data column name.setDataDescriptor
(DataDescriptor dataDescriptor) Sets the sparkline DataDescriptor.setFilterCriteria
(Criteria criteria) Sets the filter criterion used during data query.Sets component height.Sets component height.setIdFieldName
(String fieldName) Sets the DataDescriptor column name.setNegativeColor
(String negativeColor) Sets the color of the negative values on the chart.setSourceId
(Object sourceId) Sets the data column name.setTooltipChartTitle
(String tooltipChartTitle) Sets the tooltip header text.setTooltipFormat
(String tooltipFormat) Sets the tooltip format as a JavaScript.setTooltipPrefix
(String tooltipPrefix) Sets the prefix in the tooltip value.setTooltipSuffix
(String tooltipSuffix) Sets the suffix in the tooltip value.setType
(SparklineType type) Sets displayed chart type.Sets the component’s displayed values.Sets the component width.Sets the component width.boolean
writeHTML
(StringWriter writer) Creates the component's HTML equivalentMethods inherited from class com.jbstrap.ui.Component
_hide, _setAttribute, addAllowedRole, addComponent, addDeniedRole, addHandler, addStyle, addStyleClass, addStyleClasses, afterDraw, clearfix, closeTag, combinateAccess, containsStyle, containsStyleClass, draw, drawSubComponents, error, flattendComponentTree, getAccess, getAccessMode, getAllowedRoles, getAttribute, getAttributes, getBackgroundColor, getBorderColor, getClient, getComponentById, getComponents, getComponents, getComponentsByClass, getData, getDeniedRoles, getHandlers, getId, getLanguageCode, getName, getParent, getParent, getRegisteredEvents, getStyle, getStyleClasses, getTextAlign, getTextColor, getToolTip, getToolTipPosition, getTypeName, getUI, insertComponentAfter, insertComponentBefore, isAccess, isDrawn, isEnabled, isEventBubbling, isVisible, onHide, onHotKeyEventHandler, openTag, removeAllComponents, removeAllowedRole, removeAllStyleClasses, removeAttribute, removeComponent, removeDeniedRole, removeHandler, removeStyle, removeStyle, removeStyleClass, removeStyleClasses, replaceComponent, replaceStyleClass, runAfterDraw, runJavaScript, runJavaScript, runJavaScript, runOnHide, runOnShow, say, setAttribute, setBackgroundColor, setBorder, setBorderColor, setData, setDisplayType, setEnabled, setEventBubbling, setFlex, setFloating, setHeight100, setHeight25, setHeight50, setHeight75, setHeightAuto, setLanguage, setMargin, setName, setOverflow, setPadding, setParent, setScrollable, setSelectionType, setShadow, setStyle, setTextAlign, setTextColor, setToolTip, setToolTipPosition, setVisible, setWidth100, setWidth25, setWidth50, setWidth75, setWidthAuto, showNotification, showNotification, showProcessIndicator, toggleStyleClass
Methods inherited from class com.jbstrap.core.messagebus.MessageBus
closeMessageBus, messageBusOpened, openMessageBus, renewSubscription, sendMessageToMessageBus, subscribeMessageBus, unsubscribeAllListeners, unsubscribeMessageBus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jbstrap.ui.Animatable
addAnimationEndHandler, addAnimationStartHandler, getAnimation, removeAnimation, setAnimation
Methods inherited from interface com.jbstrap.ui.CanDrop
addDropEventHandler
Methods inherited from interface com.jbstrap.ui.Clickable
addClickHandler, addDoubleClickHandler
Methods inherited from interface com.jbstrap.ui.Draggable
addDragEndEventHandler, addDragStartEventHandler, setDraggable
Methods inherited from interface com.jbstrap.ui.Fetchable
addFetchDoneHandler, fireFetchDoneEvent
Methods inherited from interface com.jbstrap.ui.HandleMouseEvents
addMouseDownHandler, addMouseEnterHandler, addMouseLeaveHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler
Methods inherited from interface com.jbstrap.ui.Touchable
addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler
-
Constructor Details
-
Sparkline
public Sparkline()Creates a simple line chart. -
Sparkline
Creates a simple line chart according to the specified language code.- Parameters:
language
- Language code according to which the component is created If not specified ornull
is set, the framework’s default language code is used. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE
.
-
Sparkline
Creates a simple line chart according to the specified language code.- Parameters:
id
- The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)language
- Language code according to which the component is created If not specified ornull
is set, the framework’s default language code is used. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE
.
-
Sparkline
Creates a chart with the specified type.- Parameters:
type
- Chart type Available chart types are listed in the enumSparklineType
. Ifnull
is specified, the default chart typeSparklineType.LINE_CHART
is used to create the chart.
-
Sparkline
Creates a chart with the specified type according to the language code.- Parameters:
language
- Language code according to which the component is created If not specified ornull
is set, the framework’s default language code is used. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE
.type
- Chart type * Available chart types are listed in the enumSparklineType
. Ifnull
is specified, the default chart type is used to createSparklineType.LINE_CHART
.
-
Sparkline
Creates a simple line chart based on the specified data.- Parameters:
values
- A list containing the numeric values to be displayed Ifnull
is specified, the chart will not be displayed.
-
Sparkline
Creates a simple line chart based on the specified data according to the language code.- Parameters:
language
- Language code according to which the component is created If not specified ornull
is set, the framework’s default language code is used. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE
.values
- A list containing numeric values to be displayed Ifnull
is specified, the chart will not be displayed.
-
Sparkline
Creates a chart with the specified type and data- Parameters:
type
- Chart type * Available chart types are listed in the enumSparklineType
. Ifnull
is specified, the default chart type is used to createSparklineType.LINE_CHART
.value
- A list containing the numeric values to be displayed Ifnull
is specified, the chart will not be displayed.
-
Sparkline
Creates a chart with the specified type and data according to the language code.- Parameters:
language
- Language code according to which the component is created If not specified ornull
is set, the framework’s default language code is used. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE
.type
- Chart type * Available chart types are listed in the enumSparklineType
. Ifnull
is specified, the default chart type is used to createSparklineType.LINE_CHART
.value
- A list containing the numeric values to be displayed Ifnull
is specified, the chart will not be displayed.
-
Sparkline
Creates a chart with the specified type and data according to the language code.- Parameters:
id
- The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)language
- Language code according to which the component is created If not specified ornull
is set, the framework’s default language code is used. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE
.type
- Chart type * Available chart types are listed in the enumSparklineType
. Ifnull
is specified, the default chart type is used to createSparklineType.LINE_CHART
.value
- A list containing the numeric values to be displayed Ifnull
is specified, the chart will not be displayed.
-
Sparkline
Creates a chart based on the specified DataDescriptor column.
The method creates and sets the chart based on the specified DataDescriptor column. The component uses the following DataDescriptor column parameters:
MetaParamName.DATADESCRIPTOR
- This parameter specifies the sparkline component’s DataDescriptorMetaParamName.DATA_COLUMN
- This parameter specifies the DataDescriptor column Sparkline charts display only numeric data and the column specified here must contain numeric data.MetaParamName.CHART_TYPE
- This parameter specifies the chart type. Specify a value of theSparklineType
enum in text format. That is, enter “PIE_CHART” for a pie chart. If the parameter is not specified or you enter a text which has no equivalent in theSparklineType
enum, a line chart is displayed.MetaParamName.WIDTH
- This parameter specifies chart width. Width is specified using the CSS3 standard.MetaParamName.ID_FIELD_NAME
- This parameter specifies a DataDescriptor column name with the data set ID. The ID specified here must be the ID of the data set to be displayed.MetaParamName.CRITERIA
- This parameter specifies the filter criterion for sparkline data queries.MetaParamName.ORDER
- This parameter specifies columns separated with commas (“,”) used to order the queried data. If you place a “-” sign before a column name, it inverts the column sort order.
- Parameters:
dsColumn
- DataDescriptor column instance used to create the chart- Throws:
NullPointerException
- Thrown if the specified column is set tonull
or there is no DATADESCRIPTOR parameter in the column or the DataDescriptor specified in the DATADESCRIPTOR parameter does not exist.
-
Sparkline
Creates a chart based on the specified DataDescriptor column according to the language code.
The method creates and sets the chart based on the DataDescriptor column. The component uses the following DataDescriptor column parameters:
MetaParamName.DATADESCRIPTOR
- This parameter specifies the sparkline component’s DataDescriptorMetaParamName.DATA_COLUMN
- This parameter specifies the DataDescriptor column A sparkline chart only displays numeric data and the column specified here must also contain numeric data.MetaParamName.CHART_TYPE
- This parameter specifies the chart type. Specify a value of theSparklineType
enum in text format. That is, enter “PIE_CHART” for a pie chart. If the parameter is not specified or you enter a text which has no equivalent in theSparklineType
enum, a line chart is displayed.MetaParamName.WIDTH
- This parameter specifies chart width. Width is specified using the CSS3 standard.MetaParamName.ID_FIELD_NAME
- This parameter specifies a DataDescriptor column name with the data set ID. The ID specified here must be the ID of the data set to be displayed.MetaParamName.CRITERIA
- This parameter specifies the filter criterion for sparkline data queries.MetaParamName.ORDER
- This parameter specifies columns separated with commas (“,”) used to order the queried data. If you place a “-” sign before a column name, it inverts the column sort order.
- Parameters:
dsColumn
- DataDescriptor column instance used to create the chartlanguage
- Language code according to which the component is created If not specified ornull
is set, the framework’s default language code is used. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE
.- Throws:
NullPointerException
- Thrown if the specified column is set tonull
or there is no DATADESCRIPTOR parameter in the column or the DataDescriptor specified in the DATADESCRIPTOR parameter does not exist.
-
-
Method Details
-
addComponent
Adds another sparkline component to the current one.- Overrides:
addComponent
in classComponent<Sparkline>
- Parameters:
component
- Sparkline component to be added- Returns:
- Sparkline component
- Throws:
UnsupportedOperationException
- Thrown if the specified component is not a sparkline component or if the current component already contains one or more sparklines
-
addComponents
Adds multiple sparkline components to the current one.- Overrides:
addComponents
in classComponent<Sparkline>
- Parameters:
components
- An enumeration of sparkline components to be added- Returns:
- Sparkline component
- Throws:
UnsupportedOperationException
- Thrown if one of the specified components is not a sparkline component or if the current component already contains one or more sparklines
-
removeComponent
Removes a sparkline component from the current one.- Overrides:
removeComponent
in classComponent<Sparkline>
- Parameters:
component
- Sparkline component to be removed- Returns:
- Sparkline component
- Throws:
UnsupportedOperationException
- Thrown if the specified component is not a sparkline component
-
removeComponents
Removes multiple sparkline components from the current one.- Overrides:
removeComponents
in classComponent<Sparkline>
- Parameters:
components
- An enumeration of all sparkline components to be removed- Returns:
- Sparkline component
- Throws:
UnsupportedOperationException
- Thrown if one of the specified components is not a sparkline component
-
writeHTML
Description copied from class:Component
Creates the component's HTML equivalentThis method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (
StringWriter
class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return withfalse
. Otherwise, it must return withtrue
. -
init
Description copied from class:Component
The component initialization method.Empty method, only needs to be overwritten when making a custom component, that needs to call an initializing JavaScript on the client side. The method is called by the framework after the component is drawn, but before the afterDraw() method. The use of this method during application development is not allowed. This method is meant for inner use only.
- Overrides:
init
in classComponent<Sparkline>
- Throws:
JavaScriptLoadError
- If there was a JavaScript error during the initialization.
-
onShow
public void onShow()Description copied from class:Component
The operations to be executed after the component is displayed on the clientBy default, this is an empty method. It has to be overwritten on a component or page, if additional operations have to be executed after the component is displayed. This method is nearly identical to the afterDraw() method, they differ in when they are executed. This method runs after the component is displayed on the client. Meaning that it is executed even if the component isn't redrawn, but only set to be visible after being hidden.
-
redraw
Redraws the component on the interface. -
setSourceId
Sets the data column name. The DataDescriptor column identifies the data set to be displayed.- Parameters:
sourceId
- DataDescriptor column name- Returns:
- Sparkline component
-
getSourceId
Sets the data column name. The DataDescriptor column identifies the data set to be displayed.- Returns:
- The name of the DataDescriptor containing displayed values or
null
if not set
-
fetchData
Queries data from the database.- Specified by:
fetchData
in interfaceFetchable<Sparkline>
- Returns:
- The component
- Throws:
IllegalArgumentException
- Thrown if there is no DataDescriptor set for the component or there is a DataDescriptor, but the column with the displayed values is not specified or the data set ID is not specified
-
clearValue
Deletes sparkline component values.- Returns:
- Sparkline component
-
getType
Gets the displayed chart type.- Returns:
- Chart type
-
setType
Sets displayed chart type.- Parameters:
type
- Chart type Available chart types are listed in the enumSparklineType
. Ifnull
is set, the defaultSparklineType.LINE_CHART
is used.- Returns:
- Sparkline component
-
getValue
Gets the displayed values.- Returns:
- A list of displayed numeric values If the component does not contain any values, an empty list is returned.
-
setValue
Sets the component’s displayed values. The values specified here overwrite previous values.- Parameters:
value
- A list of numeric values Ifnull
is specified, the chart will not be displayed.- Returns:
- Sparkline component
-
getWidth
Gets the component’s width.- Returns:
- The current width of the component as entered or the default width
-
setWidth
Sets the component width.- Parameters:
width
- Width in pixels Ifnull
is set, the method does nothing.- Returns:
- Sparkline component
- Throws:
UnsupportedOperationException
- Thrown if the displayed chart type isSparklineType.DISCRETE_CHART
-
setWidth
Sets the component width.- Parameters:
width
- Component width as defined in CSS3 Ifnull
is set, the method does nothing.- Returns:
- Sparkline component
- Throws:
UnsupportedOperationException
- Thrown if the displayed chart type isSparklineType.DISCRETE_CHART
-
getHeight
Gets the component height.- Returns:
- Component height as entered or
null
if no component height is specified
-
setHeight
Sets component height.- Parameters:
height
- Component height in pixels Ifnull
is set, the method does nothing.- Returns:
- Sparkline component
-
setHeight
Sets component height.- Parameters:
height
- The height value of the component as defined in CSS3 Ifnull
is set, the method does nothing.- Returns:
- Sparkline component
-
getChartRangeMin
Gets the chart’s minimum value.- Returns:
- The chart’s minimum value or
null
if not set
-
setChartRangeMin
Sets the minimum value for the chart.- Parameters:
chartRangeMin
- Minimum value for the chart Ifnull
is set, the minimum value is deleted.- Returns:
- Sparkline component
-
getChartRangeMax
Gets the chart’s maximum value.- Returns:
- The chart’s maximum value or
null
if not set
-
setChartRangeMax
Sets the maximum value for the chart.- Parameters:
chartRangeMax
- Maximum value for the chart Ifnull
is set, the method does nothing.- Returns:
- Sparkline component
-
getColor
Gets chart color.- Returns:
- Chart color or
null
if no chart color is specified
-
setColor
Sets chart color.- Parameters:
color
- Chart color as defined in the CSS3 standard Ifnull
is set, the chart color is deleted.- Returns:
- Sparkline component
-
getNegativeColor
Gets the color of the negative values on the chart.- Returns:
- The color of the negative values on the chart or
null
if not specified
-
setNegativeColor
Sets the color of the negative values on the chart.- Parameters:
negativeColor
- The color of the negative values on the chart as defined in the CSS3 standard * Ifnull
is set, the color is deleted.- Returns:
- Sparkline component
-
getDataDescriptor
Gets the sparkline DataDescriptor.- Specified by:
getDataDescriptor
in interfaceBasedOnDataDescriptor<Sparkline>
- Returns:
- DataDescriptor used by the sparkline or
null
if no DataDescriptor is specified
-
setDataDescriptor
Sets the sparkline DataDescriptor.- Specified by:
setDataDescriptor
in interfaceBasedOnDataDescriptor<Sparkline>
- Parameters:
dataDescriptor
- DataDescriptor instance used by the component Ifnull
is set, the DataDescriptor associated with the component is deleted and the component is unable to read data from it.- Returns:
- Sparkline component
-
getDataColumn
Gets the column name containing the displayed values.- Returns:
- The name of the DataDescriptor column containing displayed values or
null
if not set
-
setDataColumn
Sets the data column name. The DataDescriptor column identifies the data set to be displayed.- Parameters:
dataColumn
- DataDescriptor column name- Returns:
- Sparkline component
-
getFilterCriteria
Gets the filter criterion used for the query.- Returns:
- Filter criterion used for the query or
null
if no filter criterion is specified
-
setFilterCriteria
Sets the filter criterion used during data query.- Parameters:
criteria
- Filter criterion used for data query Ifnull
is set, no filter criterion is used for data query.- Returns:
- Sparkline component
-
getTooltipPrefix
Gets the prefix in the tooltip value.- Returns:
- Prefix in the tooltip value or
null
if not specified
-
setTooltipPrefix
Sets the prefix in the tooltip value.- Parameters:
tooltipPrefix
- Tooltip value prefix Ifnull
is set, the tooltip value has no prefix.- Returns:
- Sparkline component
-
getTooltipSuffix
Gets tooltip value suffix.- Returns:
- Tooltip value suffix or
null
if not specified
-
setTooltipSuffix
Sets the suffix in the tooltip value.- Parameters:
tooltipSuffix
- Tooltip value suffix Ifnull
is set, no tooltip value suffix is displayed.- Returns:
- Sparkline component
-
getTooltipChartTitle
Gets the tooltip header text.- Returns:
- Tooltip header text or
null
if no tooltip header text is specified
-
setTooltipChartTitle
Sets the tooltip header text.- Parameters:
tooltipChartTitle
- Tooltip header text Ifnull
is set, no tooltip header text is displayed.- Returns:
- Sparkline component
-
isComposite
public boolean isComposite()Checks if the component is a composite sparkline component. If true, multiple sparkline components are integrated into a single sparkline component.- Returns:
- If
true
, the component is a composite one, otherwisefalse
-
getTooltipFormat
Gets tooltip format.- Returns:
- Tooltip format or
null
if not specified
-
setTooltipFormat
Sets the tooltip format as a JavaScript.- Parameters:
tooltipFormat
- Format- See Also:
-
getColumn
Gets the DataDescriptor column for the component value.- Returns:
- The DataDescriptor column instance used to build the component or
null
-
setIdFieldName
Sets the DataDescriptor column name. The DataDescriptor column identifies the data set to be displayed.- Parameters:
fieldName
- DataDescriptor column name referencing the data set to be displayed- Returns:
- Sparkline component
-
getIdFieldName
Gets the DataDescriptor column name referencing the data set to be displayed.- Returns:
- DataDescriptor column name referencing the data set to be displayed or
null
if not set
-
setAutoFetchData
Sets if the component automatically queries the data from the database upon being displayed. By default, the component automatically queries the displayed data from the database.- Specified by:
setAutoFetchData
in interfaceFetchable<Sparkline>
- Parameters:
autoFetch
- Iftrue
, the component automatically queries data upon being displayed Iffalse
, data are not automatically queried. Data query must be implemented by calling thefetchData()
method.- Returns:
- Sparkline component
-
isAutoFetchData
public boolean isAutoFetchData()Checks if data query is automatically performed.- Specified by:
isAutoFetchData
in interfaceFetchable<Sparkline>
- Returns:
- If
true
, data query is performed automatically Otherwisefalse
.
-
setCustomFetch
Sets a custom query. When calling the fetchData method, the specifiedFetchEvent
implementation is called, then callback methods are run on records returned by the
onFetch
method.- Parameters:
fetchEvent
- Custom query implementation
-
fetch
public List<Record> fetch(int startRow, int endRow, Criteria criteria, List<Order> orders, Client client) throws FindException, DataAccessException Description copied from interface:Fetchable
This method implements actual data retrieval. TheFetchable.fetchData()
function runs callback methods on the returned records.- Specified by:
fetch
in interfaceFetchable<Sparkline>
- Parameters:
startRow
- The first row of the query that appears in the returned listendRow
- The last row of the query that appears in the returned listcriteria
- The criteria used during the query Ifnull
, no criteria will be used, every record is queried.orders
- The orderings that will be applied to the query results. Ifnull
, the data will not be ordered.client
- The client that started the query. Ifnull
, the query will happen without checking for access rights.- Returns:
- The list of records that meet the specified filter criteria.
- Throws:
FindException
- Occurs if an error was encountered during the queryDataAccessException
- Occurs if the user in the specified client has no access to read the data
-