public class DataProviderSeries<T> extends AbstractSeries
You must use setY(SerializableFunction)
to define which part of the
data bean to use as y
values.
Note that even if you use a lazy loading DataProvider
, this series
will work in an eager fashion and load all the data from the provider at
once.
Modifier and Type | Field and Description |
---|---|
static String |
CLOSE_PROPERTY |
static String |
HIGH_PROPERTY |
static String |
LOW_PROPERTY |
static String |
OPEN_PROPERTY |
static String |
X_ATTRIBUTE |
static String |
Y_ATTRIBUTE |
Constructor and Description |
---|
DataProviderSeries(DataProvider<T,?> dataProvider)
Creates a new series using data from the given data provider.
|
DataProviderSeries(DataProvider<T,?> dataProvider,
SerializableFunction<T,Object> callBack)
Creates a new series using data from the given data provider and y
values.
|
Modifier and Type | Method and Description |
---|---|
Set<String> |
getChartAttributes()
Returns a set of chart attributes(keys).
|
DataProvider<T,?> |
getDataProvider()
Returns the underlying data provider.
|
List<Map<String,Optional<Object>>> |
getValues()
Returns a list mappings between chart attributes(keys) and values.
|
boolean |
isAutomaticChartUpdateEnabled()
Returns true if the chart is updated automatically when a DataChangeEvent
is emitted by the data provider.
|
void |
setAutomaticChartUpdateEnabled(boolean automaticChartUpdateEnabled)
Sets if the chart should be updated automatically when a DataChangeEvent
is emitted by the data provider.
|
void |
setClose(SerializableFunction<T,Object> callBack)
Sets the function used for retrieving
close values from the
bean provided by the data provider. |
void |
setHigh(SerializableFunction<T,Object> callBack)
Sets the function used for retrieving
high values from the
bean provided by the data provider. |
void |
setLow(SerializableFunction<T,Object> callBack)
Sets the function used for retrieving
low values from the
bean provided by the data provider. |
void |
setOpen(SerializableFunction<T,Object> callBack)
Sets the function used for retrieving
open values from the
bean provided by the data provider. |
void |
setPointName(SerializableFunction<T,Object> callBack)
Sets the function used for retrieving
name values from the
bean provided by the data provider. |
void |
setProperty(String propertyName,
SerializableFunction<T,Object> callBack)
Sets the function used for retrieving the value for the given property
name from the given data provider.
|
void |
setX(SerializableFunction<T,Object> callBack)
Sets the function used for retrieving
x values from the bean
provided by the data provider. |
void |
setY(SerializableFunction<T,Object> callBack)
Sets the function used for retrieving
y values from the bean
provided by the data provider. |
getColorAxis, getConfiguration, getId, getName, getPlotOptions, getStack, getxAxis, getyAxis, isVisible, setColorAxis, setConfiguration, setId, setName, setPlotOptions, setStack, setVisible, setVisible, setxAxis, setyAxis, setyAxis, updateSeries
public static final String X_ATTRIBUTE
public static final String Y_ATTRIBUTE
public static final String HIGH_PROPERTY
public static final String LOW_PROPERTY
public static final String OPEN_PROPERTY
public static final String CLOSE_PROPERTY
public DataProviderSeries(DataProvider<T,?> dataProvider)
Many chart types such as ChartType.BAR
, ChartType.LINE
,
ChartType.AREA
etc use y
values to define the data points
to show in the chart. For these chart types you should use either
DataProviderSeries(DataProvider, SerializableFunction)
or
setY(SerializableFunction)
to define the function (lambda) which
extracts the values from the bean in the provider.
Other chart types such as ChartType.ERRORBAR
do not require
y
values but instead high
and low
values.
Functions for extracting these are set using
setHigh(SerializableFunction)
and
setLow(SerializableFunction)
respectively.
dataProvider
- the data provider which contains the datapublic DataProviderSeries(DataProvider<T,?> dataProvider, SerializableFunction<T,Object> callBack)
dataProvider
- the data provider which contains the datacallBack
- the function which retrieves the y valuespublic void setProperty(String propertyName, SerializableFunction<T,Object> callBack)
propertyName
- the property namecallBack
- the function which retrieves the value for the propertypublic void setX(SerializableFunction<T,Object> callBack)
x
values from the bean
provided by the data provider.
How exactly the values are used depends on the used chart type.
callBack
- the function which retrieves the valuespublic void setY(SerializableFunction<T,Object> callBack)
y
values from the bean
provided by the data provider.
How exactly the values are used depends on the used chart type.
callBack
- the function which retrieves the valuespublic void setPointName(SerializableFunction<T,Object> callBack)
name
values from the
bean provided by the data provider.
How exactly the values are used depends on the used chart type.
callBack
- the function which retrieves the valuespublic void setLow(SerializableFunction<T,Object> callBack)
low
values from the
bean provided by the data provider.
How exactly the values are used depends on the used chart type.
callBack
- the function which retrieves the valuespublic void setHigh(SerializableFunction<T,Object> callBack)
high
values from the
bean provided by the data provider.
How exactly the values are used depends on the used chart type.
callBack
- the function which retrieves the valuespublic void setOpen(SerializableFunction<T,Object> callBack)
open
values from the
bean provided by the data provider.
How exactly the values are used depends on the used chart type.
callBack
- the function which retrieves the valuespublic void setClose(SerializableFunction<T,Object> callBack)
close
values from the
bean provided by the data provider.
How exactly the values are used depends on the used chart type.
callBack
- the function which retrieves the valuespublic DataProvider<T,?> getDataProvider()
public List<Map<String,Optional<Object>>> getValues()
public Set<String> getChartAttributes()
public boolean isAutomaticChartUpdateEnabled()
public void setAutomaticChartUpdateEnabled(boolean automaticChartUpdateEnabled)
automaticChartUpdateEnabled
- True sets the chart updating to enabled, false disables it.Copyright © 2024. All rights reserved.