Package io.jmix.charts.model.chart.impl
Class StockChartGroup
java.lang.Object
io.jmix.charts.model.AbstractChartObject
io.jmix.charts.model.chart.impl.ChartModelImpl
io.jmix.charts.model.chart.impl.StockChartGroup
- All Implemented Interfaces:
StockChartModel<StockChartGroup>
,DataSet.DataProviderChangeListener
,HasColors<StockChartGroup>
,Serializable
public class StockChartGroup
extends ChartModelImpl
implements StockChartModel<StockChartGroup>, HasColors<StockChartGroup>, DataSet.DataProviderChangeListener
See documentation for properties of AmStockChart JS object.
http://docs.amcharts.com/3/javascriptstockchart/AmStockChart
http://docs.amcharts.com/3/javascriptstockchart/AmStockChart
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
static class
static interface
static enum
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds colors.addComparedDataSets
(String... comparedDataSets) Adds compared data sets.void
addDataSets
(DataSet... dataSets) Adds data sets.void
addPanels
(StockPanel... panels) Adds stock panels.protected void
fireDataSetsChanged
(List<DataSet> dataSets, StockChartGroup.Operation operation) getDataSet
(String id) Gets data set by id.getPath()
getTheme()
getType()
void
void
void
setAddClassNames
(Boolean addClassNames) Set addClassNames to true, if class names should be added to chart elements.setAdditionalFields
(List<String> additionalFields) Sets list of additional fields.setAnimationPlayed
(Boolean animationPlayed) Specifies if animation was already played.setAutoResize
(Boolean autoResize) Set autoResize to true if you want chart to resize itself whenever its parent container size changes.setBalloon
(Balloon balloon) Sets the balloon.setCategoryAxesSettings
(CategoryAxesSettings categoryAxesSettings) Sets settings for category axes.setChartCursorSettings
(ChartCursorSettings chartCursorSettings) Sets chart cursor settings.setChartScrollbarSettings
(ChartScrollbarSettings chartScrollbarSettings) Sets chart scrollbar settings.setClassNamePrefix
(String classNamePrefix) Sets the class name prefix.Sets the list of colors.setComparedDataSets
(List<String> comparedDataSets) Sets the list of of data sets selected for comparing.setDataDateFormat
(String dataDateFormat) Sets data date format.setDataSets
(List<DataSet> dataSets) Sets the list of data sets.setDataSetSelector
(DataSetSelector dataSetSelector) Sets data set selector.Sets the export menu.setExtendToFullPeriod
(Boolean extendToFullPeriod) Specifies if the chart should always display full first and last data item when data is grouped to a longer period if the chart is zoomed from the beginning or end of the data.setFirstDayOfWeek
(Integer firstDayOfWeek) Sets day week starts.setGlueToTheEnd
(Boolean glueToTheEnd) Set glueToTheEnd to true if the scope of the data view should be set to the end after data update.setLanguage
(String language) Sets language of default.setLegendSettings
(LegendSettings legendSettings) Sets legend settings.setMainDataSet
(String mainDataSet) Sets data set as main.setMouseWheelScrollEnabled
(Boolean mouseWheelScrollEnabled) Set mouseWheelScrollEnabled to true you wont to scroll chart with mouse wheel.setPanels
(List<StockPanel> panels) Sets list of stock panels.setPanelsSettings
(PanelsSettings panelsSettings) Sets settings for stock panels.Specifies absolute or relative path to amCharts files.setPathToImages
(String pathToImages) Specifies path to the folder where images like resize grips, lens and similar are.setPeriodSelector
(PeriodSelector periodSelector) Sets period selector.setProcessTimeout
(Integer processTimeout) Sets the process timeout.setStockEventsSettings
(StockEventsSettings stockEventsSettings) Sets settings for stock events.setTheme
(ChartTheme theme) Sets theme of a chart.setValueAxesSettings
(ValueAxesSettings valueAxesSettings) Sets settings for value axes.setZoomOutOnDataSetChange
(Boolean zoomOutOnDataSetChange) Specifies whether the chart should zoom-out when main data set is changed.
-
Constructor Details
-
StockChartGroup
public StockChartGroup()
-
-
Method Details
-
getAddClassNames
- Specified by:
getAddClassNames
in interfaceStockChartModel<StockChartGroup>
- Returns:
- true if addClassNames option is enabled
-
setAddClassNames
Description copied from interface:StockChartModel
Set addClassNames to true, if class names should be added to chart elements.- Specified by:
setAddClassNames
in interfaceStockChartModel<StockChartGroup>
- Parameters:
addClassNames
- add class names option- Returns:
- stock chart model
-
getExport
- Specified by:
getExport
in interfaceStockChartModel<StockChartGroup>
- Returns:
- export menu
-
setExport
Description copied from interface:StockChartModel
Sets the export menu.- Specified by:
setExport
in interfaceStockChartModel<StockChartGroup>
- Parameters:
export
- export menu- Returns:
- stock chart model
-
getAnimationPlayed
- Specified by:
getAnimationPlayed
in interfaceStockChartModel<StockChartGroup>
- Returns:
- true if animation was already played
-
setAnimationPlayed
Description copied from interface:StockChartModel
Specifies if animation was already played. Animation is only played once, when chart is rendered for the first time. If you want the animation to be repeated, set this property to false.- Specified by:
setAnimationPlayed
in interfaceStockChartModel<StockChartGroup>
- Parameters:
animationPlayed
- animation played option- Returns:
- stock chart model
-
getAutoResize
- Specified by:
getAutoResize
in interfaceStockChartModel<StockChartGroup>
- Returns:
- true if autoResize is enabled
-
setAutoResize
Description copied from interface:StockChartModel
Set autoResize to true if you want chart to resize itself whenever its parent container size changes. If not set the default value is true.- Specified by:
setAutoResize
in interfaceStockChartModel<StockChartGroup>
- Parameters:
autoResize
- auto resize option- Returns:
- stock chart model
-
getBalloon
- Specified by:
getBalloon
in interfaceStockChartModel<StockChartGroup>
- Returns:
- balloon
-
setBalloon
Description copied from interface:StockChartModel
Sets the balloon.- Specified by:
setBalloon
in interfaceStockChartModel<StockChartGroup>
- Parameters:
balloon
- the balloon- Returns:
- stock chart model
-
getCategoryAxesSettings
- Specified by:
getCategoryAxesSettings
in interfaceStockChartModel<StockChartGroup>
- Returns:
- category axis settings
-
setCategoryAxesSettings
Description copied from interface:StockChartModel
Sets settings for category axes.- Specified by:
setCategoryAxesSettings
in interfaceStockChartModel<StockChartGroup>
- Parameters:
categoryAxesSettings
- category axis settings- Returns:
- stock chart model
-
getChartCursorSettings
- Specified by:
getChartCursorSettings
in interfaceStockChartModel<StockChartGroup>
- Returns:
- chart cursor settings
-
setChartCursorSettings
Description copied from interface:StockChartModel
Sets chart cursor settings.- Specified by:
setChartCursorSettings
in interfaceStockChartModel<StockChartGroup>
- Parameters:
chartCursorSettings
- chart cursor settings- Returns:
- stock chart model
-
getChartScrollbarSettings
- Specified by:
getChartScrollbarSettings
in interfaceStockChartModel<StockChartGroup>
-
setChartScrollbarSettings
Description copied from interface:StockChartModel
Sets chart scrollbar settings.- Specified by:
setChartScrollbarSettings
in interfaceStockChartModel<StockChartGroup>
- Parameters:
chartScrollbarSettings
- chart scrollbar settings- Returns:
- stock chart model
-
getClassNamePrefix
- Specified by:
getClassNamePrefix
in interfaceStockChartModel<StockChartGroup>
- Returns:
- class name prefix
-
setClassNamePrefix
Description copied from interface:StockChartModel
Sets the class name prefix. This prefix is added to all class names which are added to all visual elements of a chart in case addClassNames is set to true. If not set the default value is "amcharts".- Specified by:
setClassNamePrefix
in interfaceStockChartModel<StockChartGroup>
- Parameters:
classNamePrefix
- class name prefix string- Returns:
- stock chart model
-
getColors
- Specified by:
getColors
in interfaceHasColors<StockChartGroup>
- Returns:
- List of colors
-
setColors
Description copied from interface:HasColors
Sets the list of colors.If you use charts based on
SlicedChartModelImpl
it specifies the colors of the slices, if the slice color is not set. If there are more slices than colors in this array, the chart picks random color.If you use charts based on
CoordinateChartModelImpl
orStockChartModel
it specifies the colors of the graphs if the lineColor of a graph is not set. If there are more graphs then colors in this array, the chart picks a random color. If not set the default value is["#FF6600", "#FCD202", "#B0DE09", "#0D8ECF", "#2A0CD0", "#CD0D74", "#CC0000", "#00CC00", "#0000CC", "#DDDDDD", "#999999", "#333333", "#990000"]
If you use chart based on
SlicedChartModelImpl
(PieChart, FunnelChart). Specifies the colors of the slices, if the slice color is not set. If there are more slices than colors in this array, the chart picks random color. If not set default value is["#FF0F00", "#FF6600", "#FF9E01", "#FCD202", "#F8FF01", "#B0DE09", "#04D215", "#0D8ECF", "#0D52D1", "#2A0CD0", "#8A0CCF", "#CD0D74", "#754DEB", "#DDDDDD", "#999999", "#333333", "#000000", "#57032A", "#CA9726", "#990000", "#4B0C25"]
- Specified by:
setColors
in interfaceHasColors<StockChartGroup>
- Parameters:
colors
- list of colors- Returns:
- chart
-
addColors
Description copied from interface:HasColors
Adds colors.- Specified by:
addColors
in interfaceHasColors<StockChartGroup>
- Parameters:
colors
- list of colors- Returns:
- chart
-
getComparedDataSets
- Specified by:
getComparedDataSets
in interfaceStockChartModel<StockChartGroup>
- Returns:
- list of compared data sets
-
setComparedDataSets
Description copied from interface:StockChartModel
Sets the list of of data sets selected for comparing.- Specified by:
setComparedDataSets
in interfaceStockChartModel<StockChartGroup>
- Parameters:
comparedDataSets
- compared data sets- Returns:
- stock chart model
-
addComparedDataSets
Description copied from interface:StockChartModel
Adds compared data sets.- Specified by:
addComparedDataSets
in interfaceStockChartModel<StockChartGroup>
- Parameters:
comparedDataSets
- compared data sets- Returns:
- stock chart model
-
getDataDateFormat
- Specified by:
getDataDateFormat
in interfaceStockChartModel<StockChartGroup>
- Returns:
- data date format
-
setDataDateFormat
Description copied from interface:StockChartModel
Sets data date format. Please note, that two-digit years "YY" is NOT supported in this setting.- Specified by:
setDataDateFormat
in interfaceStockChartModel<StockChartGroup>
- Parameters:
dataDateFormat
- data date format string- Returns:
- stock chart model
-
getDataSets
- Specified by:
getDataSets
in interfaceStockChartModel<StockChartGroup>
- Returns:
- list of data sets
-
setDataSets
Description copied from interface:StockChartModel
Sets the list of data sets.- Specified by:
setDataSets
in interfaceStockChartModel<StockChartGroup>
- Parameters:
dataSets
- list of data sets- Returns:
- stock chart model
-
addDataSets
Description copied from interface:StockChartModel
Adds data sets.- Specified by:
addDataSets
in interfaceStockChartModel<StockChartGroup>
- Parameters:
dataSets
- data sets- Returns:
- stock chart model
-
fireDataSetsChanged
-
getDataSetSelector
- Specified by:
getDataSetSelector
in interfaceStockChartModel<StockChartGroup>
- Returns:
- data set selector
-
setDataSetSelector
Description copied from interface:StockChartModel
Sets data set selector. You can add it if you have more than one data set and want users to be able to select/compare them.- Specified by:
setDataSetSelector
in interfaceStockChartModel<StockChartGroup>
- Parameters:
dataSetSelector
- data set selector- Returns:
- stock chart model
-
getExtendToFullPeriod
- Specified by:
getExtendToFullPeriod
in interfaceStockChartModel<StockChartGroup>
- Returns:
- true if chart always displays full first and last data item when data is grouped to a longer period if the chart is zoomed from the beginning or end of the data
-
setExtendToFullPeriod
Description copied from interface:StockChartModel
Specifies if the chart should always display full first and last data item when data is grouped to a longer period if the chart is zoomed from the beginning or end of the data. If not set the default value is true.- Specified by:
setExtendToFullPeriod
in interfaceStockChartModel<StockChartGroup>
- Parameters:
extendToFullPeriod
- extend to full period option- Returns:
- stock chart model
-
getFirstDayOfWeek
- Specified by:
getFirstDayOfWeek
in interfaceStockChartModel<StockChartGroup>
- Returns:
- first day of week
-
setFirstDayOfWeek
Description copied from interface:StockChartModel
Sets day week starts. 0 - Sunday, 1 - Monday etc. If not set the default value is 1.- Specified by:
setFirstDayOfWeek
in interfaceStockChartModel<StockChartGroup>
- Parameters:
firstDayOfWeek
- first day of week- Returns:
- stock chart model
-
getGlueToTheEnd
- Specified by:
getGlueToTheEnd
in interfaceStockChartModel<StockChartGroup>
- Returns:
- true if the scope of the data view is set to the end after data update
-
setGlueToTheEnd
Description copied from interface:StockChartModel
Set glueToTheEnd to true if the scope of the data view should be set to the end after data update. If not set the default value is false.- Specified by:
setGlueToTheEnd
in interfaceStockChartModel<StockChartGroup>
- Parameters:
glueToTheEnd
- glue to the end option- Returns:
- stock chart model
-
getLanguage
- Specified by:
getLanguage
in interfaceStockChartModel<StockChartGroup>
- Returns:
- language
-
setLanguage
Description copied from interface:StockChartModel
Sets language of default. Note, you should include language js file from amcharts/lang and then use variable name used in this file, likesetLanguage("de")
.- Specified by:
setLanguage
in interfaceStockChartModel<StockChartGroup>
- Parameters:
language
- language string- Returns:
- stock chart model
-
getLegendSettings
- Specified by:
getLegendSettings
in interfaceStockChartModel<StockChartGroup>
- Returns:
- legend settings
-
setLegendSettings
Description copied from interface:StockChartModel
Sets legend settings.- Specified by:
setLegendSettings
in interfaceStockChartModel<StockChartGroup>
- Parameters:
legendSettings
- legend settings- Returns:
- stock chart model
-
getMainDataSet
- Specified by:
getMainDataSet
in interfaceStockChartModel<StockChartGroup>
- Returns:
- main data set
-
setMainDataSet
Description copied from interface:StockChartModel
Sets data set as main.- Specified by:
setMainDataSet
in interfaceStockChartModel<StockChartGroup>
- Parameters:
mainDataSet
- main data set- Returns:
- stock chart model
-
getMouseWheelScrollEnabled
- Specified by:
getMouseWheelScrollEnabled
in interfaceStockChartModel<StockChartGroup>
- Returns:
- true if scrolling of a chart with mouse wheel is enabled
-
setMouseWheelScrollEnabled
Description copied from interface:StockChartModel
Set mouseWheelScrollEnabled to true you wont to scroll chart with mouse wheel. If not set the default value is false.- Specified by:
setMouseWheelScrollEnabled
in interfaceStockChartModel<StockChartGroup>
- Parameters:
mouseWheelScrollEnabled
- mouse wheel scroll option- Returns:
- stock chart model
-
getPanels
- Specified by:
getPanels
in interfaceStockChartModel<StockChartGroup>
- Returns:
- list of stock panels
-
setPanels
Description copied from interface:StockChartModel
Sets list of stock panels.- Specified by:
setPanels
in interfaceStockChartModel<StockChartGroup>
- Parameters:
panels
- list of stock panels- Returns:
- stock chart model
-
addPanels
Description copied from interface:StockChartModel
Adds stock panels.- Specified by:
addPanels
in interfaceStockChartModel<StockChartGroup>
- Parameters:
panels
- stock panels- Returns:
- stock chart model
-
getPanelsSettings
- Specified by:
getPanelsSettings
in interfaceStockChartModel<StockChartGroup>
- Returns:
- panel settings
-
setPanelsSettings
Description copied from interface:StockChartModel
Sets settings for stock panels.- Specified by:
setPanelsSettings
in interfaceStockChartModel<StockChartGroup>
- Parameters:
panelsSettings
- panel settings- Returns:
- stock chart model
-
getPath
- Specified by:
getPath
in interfaceStockChartModel<StockChartGroup>
- Returns:
- path
-
setPath
Description copied from interface:StockChartModel
Specifies absolute or relative path to amCharts files.- Specified by:
setPath
in interfaceStockChartModel<StockChartGroup>
- Parameters:
path
- the path string- Returns:
- stock chart model
-
getPathToImages
- Specified by:
getPathToImages
in interfaceStockChartModel<StockChartGroup>
-
setPathToImages
Description copied from interface:StockChartModel
Specifies path to the folder where images like resize grips, lens and similar are.- Specified by:
setPathToImages
in interfaceStockChartModel<StockChartGroup>
- Parameters:
pathToImages
- path to images- Returns:
- stock chart model
-
getPeriodSelector
- Specified by:
getPeriodSelector
in interfaceStockChartModel<StockChartGroup>
- Returns:
- period selector
-
setPeriodSelector
Description copied from interface:StockChartModel
Sets period selector. You can add it if you want user's to be able to enter date ranges or zoom chart with predefined period buttons.- Specified by:
setPeriodSelector
in interfaceStockChartModel<StockChartGroup>
- Parameters:
periodSelector
- period selector- Returns:
- stock chart model
-
getStockEventsSettings
- Specified by:
getStockEventsSettings
in interfaceStockChartModel<StockChartGroup>
- Returns:
- stock events settings
-
setStockEventsSettings
Description copied from interface:StockChartModel
Sets settings for stock events.- Specified by:
setStockEventsSettings
in interfaceStockChartModel<StockChartGroup>
- Parameters:
stockEventsSettings
- stock events settings- Returns:
- stock chart model
-
getTheme
- Specified by:
getTheme
in interfaceStockChartModel<StockChartGroup>
- Returns:
- theme of a chart
-
setTheme
Description copied from interface:StockChartModel
Sets theme of a chart.- Specified by:
setTheme
in interfaceStockChartModel<StockChartGroup>
- Parameters:
theme
- the theme- Returns:
- stock chart model
-
getValueAxesSettings
- Specified by:
getValueAxesSettings
in interfaceStockChartModel<StockChartGroup>
- Returns:
- value axes settings
-
setValueAxesSettings
Description copied from interface:StockChartModel
Sets settings for value axes.- Specified by:
setValueAxesSettings
in interfaceStockChartModel<StockChartGroup>
- Parameters:
valueAxesSettings
- value axes settings- Returns:
- stock chart model
-
getZoomOutOnDataSetChange
- Specified by:
getZoomOutOnDataSetChange
in interfaceStockChartModel<StockChartGroup>
- Returns:
- true if chart zoom-out when main data set is changed
-
setZoomOutOnDataSetChange
Description copied from interface:StockChartModel
Specifies whether the chart should zoom-out when main data set is changed. If not set the default value is false.- Specified by:
setZoomOutOnDataSetChange
in interfaceStockChartModel<StockChartGroup>
- Parameters:
zoomOutOnDataSetChange
- zoom out on data set change option- Returns:
- stock chart model
-
getDataSet
Description copied from interface:StockChartModel
Gets data set by id.- Specified by:
getDataSet
in interfaceStockChartModel<StockChartGroup>
- Parameters:
id
- id of dataSet- Returns:
- data set
-
getType
-
getAdditionalFields
- Specified by:
getAdditionalFields
in interfaceStockChartModel<StockChartGroup>
- Returns:
- list of additional fields
-
setAdditionalFields
Description copied from interface:StockChartModel
Sets list of additional fields. Fields from your data provider that should be used directly in the chart configuration.- Specified by:
setAdditionalFields
in interfaceStockChartModel<StockChartGroup>
- Parameters:
additionalFields
- list of additional fields- Returns:
- stock chart model
-
getProcessTimeout
- Specified by:
getProcessTimeout
in interfaceStockChartModel<StockChartGroup>
- Returns:
- process timeout
-
setProcessTimeout
Description copied from interface:StockChartModel
Sets the process timeout. If you set it to 1 millisecond or some bigger value, chart will be built in chunks instead of all at once. This is useful if you work with a lot of data and the initial build of the chart takes a lot of time, which freezes the whole web application by not allowing other processes to do their job while the chart is busy. If not set the default value is 0.- Specified by:
setProcessTimeout
in interfaceStockChartModel<StockChartGroup>
- Parameters:
processTimeout
- process timeout- Returns:
- stock chart model
-
getWiredFields
- Specified by:
getWiredFields
in classChartModelImpl
- Returns:
- fields of the
DataItem
that are bound to the chart
-
onChange
- Specified by:
onChange
in interfaceDataSet.DataProviderChangeListener
-
addDataSetDataProviderChangeListener
public void addDataSetDataProviderChangeListener(StockChartGroup.DataSetDataProviderChangeListener listener) -
removeDataSetDataProviderChangeListener
public void removeDataSetDataProviderChangeListener(StockChartGroup.DataSetDataProviderChangeListener listener) -
addDataSetsChangeListener
-
removeDataSetsChangeListener
-