Package io.jmix.charts.model.chart
Interface ChartModel<T extends ChartModel>
- All Known Subinterfaces:
AngularGaugeChart
,AngularGaugeChartModel<T>
,Chart<T>
,CoordinateChart<T>
,CoordinateChartModel<T>
,FunnelChart
,FunnelChartModel<T>
,GanttChart
,GanttChartModel<T>
,PieChart
,PieChartModel<T>
,RadarChart
,RadarChartModel<T>
,RectangularChart<T>
,RectangularChartModel<T>
,SerialChart
,SeriesBasedChart<T>
,SeriesBasedChartModel<T>
,SlicedChart<T>
,SlicedChartModel<T>
,XYChart
,XYChartModel<T>
- All Known Implementing Classes:
AbstractChart
,AbstractSerialChart
,AngularGaugeChartImpl
,AngularGaugeChartModelImpl
,ChartImpl
,ChartWidget.BasicChart
,CoordinateChartImpl
,CoordinateChartModelImpl
,FunnelChartImpl
,FunnelChartModelImpl
,GanttChartImpl
,GanttChartModelImpl
,JsonChartFragment.BasicChart
,PieChartImpl
,PieChartModelImpl
,RadarChartImpl
,RadarChartModelImpl
,RectangularChartImpl
,RectangularChartModelImpl
,SerialChartImpl
,SerialChartModelImpl
,SeriesBasedChartImpl
,SlicedChartImpl
,SlicedChartModelImpl
,StockPanel
,XYChartImpl
,XYChartModelImpl
public interface ChartModel<T extends ChartModel>
-
Method Summary
Modifier and TypeMethodDescriptionaddAdditionalFields
(String... fields) Adds additional fieldsAdds data items.Adds labels.addPrefixesOfBigNumbers
(BigNumberPrefix... prefixesOfBigNumbers) Adds BigNumberPrefixes.addPrefixesOfSmallNumbers
(SmallNumberPrefix... prefixesOfSmallNumbers) Adds SmallNumberPrefixAdds titles to chart.getColor()
getDefs()
getPath()
getTheme()
setAccessible
(Boolean accessible) When enabled, chart adds aria-label attributes to columns or bullets objects.setAccessibleDescription
(String accessibleDescription) Description which will be added to node of SVG element.setAccessibleTitle
(String accessibleTitle) Description which is added to of a SVG element.setAddClassNames
(Boolean addClassNames) Specifies, if CSS class names should be added to chart elements (line, fill, column, etc).setAdditionalFields
(List<String> additionalFields) Sets list of additional fields.setAllLabels
(List<Label> allLabels) Sets the list of labels.setAutoDisplay
(Boolean autoDisplay) If you set autoDisplay to true the chart will automatically monitor changes of display style of chart’s container (or any of it’s parents) and will render chart correctly.setAutoResize
(Boolean autoResize) Set to false if you don't want chart to resize itself whenever its parent container size changes.setAutoTransform
(Boolean autoTransform) If you set it to true and your chart div (or any of the parent div) has CSS scale applied, the chart will position mouse at a correct position.setBackgroundAlpha
(Double backgroundAlpha) Sets opacity of background.setBackgroundColor
(Color backgroundColor) Sets background color.setBalloon
(Balloon balloon) Sets the balloon (tooltip) of the chart.setBorderAlpha
(Double borderAlpha) Sets opacity of chart's border.setBorderColor
(Color borderColor) Sets color of chart's border.setClassNamePrefix
(String classNamePrefix) Sets prefix to all class names which are added to all visual elements of a chart in caseAbstractChart.addClassNames
is set to true.Sets text color.setCreditsPosition
(CreditsPosition creditsPosition) Sets position of link to amCharts site.setDataProvider
(DataProvider dataProvider) Sets data provider that contains data set.setDecimalSeparator
(String decimalSeparator) Sets decimal separator.Sets any additional information to SVG, like SVG filters or clip paths.Sets export config.setFontFamily
(String fontFamily) Sets font family.setFontSize
(Integer fontSize) Sets font size.setHandDrawn
(Boolean handDrawn) If true, the lines of the chart will be distorted and will produce hand-drawn effect.setHandDrawScatter
(Integer handDrawScatter) Defines by how many pixels hand-drawn line (whenhandDrawn
is set to true) will fluctuate.setHandDrawThickness
(Integer handDrawThickness) Defines by how many pixels line thickness will fluctuate (whenhandDrawn
is set to true).setHideBalloonTime
(Integer hideBalloonTime) Sets time, in milliseconds after which balloon is hidden if the user rolls-out of the object.setLanguage
(String language) Sets language of default.Sets legend of a chart.setPanEventsEnabled
(Boolean panEventsEnabled) This setting affects touch-screen devices only.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.setPercentPrecision
(Integer percentPrecision) Sets precision of percent values.setPrecision
(Integer precision) Precision of values.setPrefixesOfBigNumbers
(List<BigNumberPrefix> prefixesOfBigNumbers) Sets the prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc.setPrefixesOfSmallNumbers
(List<SmallNumberPrefix> prefixesOfSmallNumbers) Sets prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc.setProcessCount
(Integer processCount) If processTimeout is greater than 0, 1000 data items will be parsed at a time, then the chart will make pause and continue parsing data until it finishes.setProcessTimeout
(Integer processTimeout) If you set it to 1 millisecond or some bigger value, chart will be built in chunks instead of all at once.setResponsive
(Responsive responsive) Sets a config object for Responsive pluginsetSvgIcons
(Boolean svgIcons) Sets use SVG icons (if browser supports SVG).setTapToActivate
(Boolean tapToActivate) Charts which require gestures like swipe (charts with scrollbar/cursor) used to prevent regular page scrolling and could result page to stick to the same spot if the chart occupied whole screen.setTheme
(ChartTheme theme) Sets theme of a chart.setThousandsSeparator
(String thousandsSeparator) Sets thousands separator.Sets list of titles.setTouchClickDuration
(Integer touchClickDuration) Sets the touch click duration.setUsePrefixes
(Boolean usePrefixes) If true, prefixes will be used for big and small numbers.
-
Method Details
-
getAddClassNames
Boolean getAddClassNames()- Returns:
- true if CSS class names should be added to chart elements
-
setAddClassNames
Specifies, if CSS class names should be added to chart elements (line, fill, column, etc). If not set the default value is false.
See documentation for available CSS class names.
http://www.amcharts.com/kbase/css-class-names/- Parameters:
addClassNames
- add CSS class names option- Returns:
- chart model
-
getAllLabels
- Returns:
- list of labels
-
setAllLabels
@StudioElementsGroup(caption="Labels", xmlElement="allLabels") T setAllLabels(List<Label> allLabels) Sets the list of labels.- Parameters:
allLabels
- list of labels- Returns:
- chart model
-
addLabels
Adds labels.- Parameters:
allLabels
- the labels to to add- Returns:
- chart model
-
getExport
Export getExport()- Returns:
- export config
-
setExport
Sets export config. Specifies how export to image/data export/print/annotate menu will look and behave.- Parameters:
export
- the export- Returns:
- chart model
-
getBackgroundColor
Color getBackgroundColor()- Returns:
- background color
-
setBackgroundColor
Sets background color. You should setAbstractChart.backgroundAlpha
to greater than 0 value in order background to be visible. If not set the default value is #FFFFFF.- Parameters:
backgroundColor
- the background color- Returns:
- chart model
-
getBalloon
Balloon getBalloon()- Returns:
- balloon of the chart
-
setBalloon
Sets the balloon (tooltip) of the chart.- Parameters:
balloon
- the balloon- Returns:
- chart model
-
getLegend
Legend getLegend()- Returns:
- legend of a chart
-
setLegend
Sets legend of a chart.- Parameters:
legend
- the legend- Returns:
- chart model
-
getDecimalSeparator
String getDecimalSeparator()- Returns:
- decimal separator
-
setDecimalSeparator
Sets decimal separator. If not set the default value is ".".- Parameters:
decimalSeparator
- the decimal separator string- Returns:
- chart model
-
getPercentPrecision
Integer getPercentPrecision()- Returns:
- percent precision
-
setPercentPrecision
Sets precision of percent values. -1 means percent values won't be rounded at all and show as they are. If not set the default value is 2.- Parameters:
percentPrecision
- the percent precision- Returns:
- chart model
-
getPrecision
Integer getPrecision()- Returns:
- precision
-
setPrecision
Precision of values. -1 means values won't be rounded at all and show as they are. If not set the default value is -1.- Parameters:
precision
- the precision- Returns:
- chart model
-
getDataProvider
DataProvider getDataProvider() -
setDataProvider
@StudioProperty(name="dataContainer", type=COLLECTION_DATACONTAINER_REF) T setDataProvider(DataProvider dataProvider) Sets data provider that contains data set.- Parameters:
dataProvider
- the data provider- Returns:
- chart model
-
addData
Adds data items. IfDataProvider
is null, so it createsListDataProvider
- Parameters:
dataItems
- data items to add- Returns:
- chart model
-
getPathToImages
String getPathToImages()- Returns:
- path to images
-
setPathToImages
Specifies path to the folder where images like resize grips, lens and similar are.- Parameters:
pathToImages
- path to images- Returns:
- chart model
-
getTheme
ChartTheme getTheme()- Returns:
- theme of a chart
-
setTheme
Sets theme of a chart. If not set the default value is NONE.- Parameters:
theme
- the theme- Returns:
- chart model
-
getBorderAlpha
Double getBorderAlpha()- Returns:
- opacity of chart's border
-
setBorderAlpha
Sets opacity of chart's border. Value range is 0 - 1. If not set the default value is 0.- Parameters:
borderAlpha
- the border alpha- Returns:
- chart model
-
getBorderColor
Color getBorderColor()- Returns:
- border color
-
setBorderColor
Sets color of chart's border. You should set borderAlpha to greater than 0 value in order border to be visible. If not set the default value is #000000.- Parameters:
borderColor
- the border color- Returns:
- chart model
-
getClassNamePrefix
String getClassNamePrefix()- Returns:
- class name prefix
-
setClassNamePrefix
Sets prefix to all class names which are added to all visual elements of a chart in caseAbstractChart.addClassNames
is set to true. If not set the default value is "amcharts".- Parameters:
classNamePrefix
- class name prefix string- Returns:
- chart model
-
getCreditsPosition
CreditsPosition getCreditsPosition()- Returns:
- position of link to amCharts site
-
setCreditsPosition
@StudioProperty(type=ENUMERATION, defaultValue="TOP_LEFT") T setCreditsPosition(CreditsPosition creditsPosition) Sets position of link to amCharts site. Allowed values are: top-left, top-right, bottom-left and bottom-right. Non-commercial version only. If not set the default value is TOP_LEFT.- Parameters:
creditsPosition
- the credits position- Returns:
- chart model
-
getColor
Color getColor()- Returns:
- text color
-
setColor
Sets text color. If not set the default value is "#000000".- Parameters:
color
- the text color- Returns:
- chart model
-
getFontFamily
String getFontFamily()- Returns:
- font family
-
setFontFamily
Sets font family. If not set the default value is "Verdana".- Parameters:
fontFamily
- font family string- Returns:
- chart model
-
getFontSize
Integer getFontSize()- Returns:
- font size
-
setFontSize
Sets font size. If not set the default value is 11.- Parameters:
fontSize
- the font size- Returns:
- chart model
-
getHandDrawn
Boolean getHandDrawn()- Returns:
- true if the lines of the chart should be distorted and should produce hand-drawn effect
-
setHandDrawn
If true, the lines of the chart will be distorted and will produce hand-drawn effect. Try to adjusthandDrawScatter
andhandDrawThickness
properties for a more scattered result. If not set the default value is false.- Parameters:
handDrawn
- hand drawn option- Returns:
- chart model
-
getHandDrawScatter
Integer getHandDrawScatter()- Returns:
- hand draw scatter
-
setHandDrawScatter
Defines by how many pixels hand-drawn line (whenhandDrawn
is set to true) will fluctuate. If not set the default value is 2.- Parameters:
handDrawScatter
- the hand drawn scatter- Returns:
- chart model
-
getHandDrawThickness
Integer getHandDrawThickness()- Returns:
- hand drawn thickness
-
setHandDrawThickness
Defines by how many pixels line thickness will fluctuate (whenhandDrawn
is set to true). If not set the default value is 1.- Parameters:
handDrawThickness
- the hand draw thickness- Returns:
- chart model
-
getHideBalloonTime
Integer getHideBalloonTime()- Returns:
- hide balloon time in milliseconds
-
setHideBalloonTime
Sets time, in milliseconds after which balloon is hidden if the user rolls-out of the object. Note, this is not duration of fade-out. Duration of fade-out isBalloon.fadeOutDuration
. If not set the default value is 150.- Parameters:
hideBalloonTime
- the hide balloon time in milliseconds- Returns:
- chart model
-
getPanEventsEnabled
Boolean getPanEventsEnabled()- Returns:
- true if pan events enabled
-
setPanEventsEnabled
This setting affects touch-screen devices only. If a chart is on a page, and panEventsEnabled are set to true, the page won't move if the user touches the chart first. If a chart is big enough and occupies all the screen of your touch device, the user won’t be able to move the page at all. If you think that selecting/panning the chart is a primary purpose of your users, you should set panEventsEnabled to true, otherwise - false. If not set the default value is true.- Parameters:
panEventsEnabled
- pan events enabled option- Returns:
- chart model
-
getPrefixesOfBigNumbers
List<BigNumberPrefix> getPrefixesOfBigNumbers()- Returns:
- list of BigNumberPrefix
-
setPrefixesOfBigNumbers
Sets the prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc. Prefixes are used on value axes and in the legend. To enable prefixes, setusePrefixes
property to true. If not set the default value is[{"number":1e+3, "prefix":"k"}, {"number":1e+6, "prefix":"M"}, {"number":1e+9, "prefix":"G"}, {"number":1e+12, "prefix":"T"}, {"number":1e+15, "prefix":"P"}, {"number":1e+18, "prefix":"E"}, {"number":1e+21, "prefix":"Z"}, {"number":1e+24, "prefix":"Y"}]
- Parameters:
prefixesOfBigNumbers
- list of BigNumberPrefix- Returns:
- chart model
-
addPrefixesOfBigNumbers
Adds BigNumberPrefixes.- Parameters:
prefixesOfBigNumbers
- prefixes of big numbers- Returns:
- chart model
-
getPrefixesOfSmallNumbers
List<SmallNumberPrefix> getPrefixesOfSmallNumbers()- Returns:
- list of SmallNumberPrefix
-
setPrefixesOfSmallNumbers
Sets prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc. Prefixes are used on value axes and in the legend. To enable prefixes, setusePrefixes
property to true. If not set the default value is[{"number":1e-24, "prefix":"y"}, {"number":1e-21, "prefix":"z"}, {"number":1e-18, "prefix":"a"}, {"number":1e-15, "prefix":"f"}, {"number":1e-12, "prefix":"p"}, {"number":1e-9, "prefix":"n"}, {"number":1e-6, "prefix":"μ"}, {"number":1e-3, "prefix":"m"}]
- Parameters:
prefixesOfSmallNumbers
- list of SmallNumberPrefix- Returns:
- chart model
-
addPrefixesOfSmallNumbers
Adds SmallNumberPrefix- Parameters:
prefixesOfSmallNumbers
- prefixes of small numbers- Returns:
- chart model
-
getThousandsSeparator
String getThousandsSeparator()- Returns:
- thousands separator
-
setThousandsSeparator
Sets thousands separator. If not set the default value is ".".- Parameters:
thousandsSeparator
- - thousands separator string- Returns:
- chart model
-
getTitles
- Returns:
- list of titles
-
setTitles
Sets list of titles.- Parameters:
titles
- the titles- Returns:
- chart model
-
addTitles
Adds titles to chart.- Parameters:
titles
- the titles to add- Returns:
- chart model
-
getUsePrefixes
Boolean getUsePrefixes()- Returns:
- true if uses prefixes is enabled
-
setUsePrefixes
If true, prefixes will be used for big and small numbers. You can set arrays of prefixesprefixesOfSmallNumbers
andprefixesOfBigNumbers
properties. If not set the default value is false.- Parameters:
usePrefixes
- the use prefixes option- Returns:
- chart model
-
getAdditionalFields
- Returns:
- list of additional fields
-
setAdditionalFields
Sets list of additional fields. Fields from your data provider that should be used directly in the chart configuration.- Parameters:
additionalFields
- list of additional fields- Returns:
- chart model
-
addAdditionalFields
Adds additional fields- Parameters:
fields
- the fields- Returns:
- chart model
-
getAutoDisplay
Boolean getAutoDisplay()- Returns:
- true if auto display is enabled
-
setAutoDisplay
If you set autoDisplay to true the chart will automatically monitor changes of display style of chart’s container (or any of it’s parents) and will render chart correctly. If not set the default value is false.- Parameters:
autoDisplay
- auto display option- Returns:
- chart model
-
getAutoResize
Boolean getAutoResize()- Returns:
- true if chart should resize itself whenever its parent container size changes
-
setAutoResize
Set to false if you don't want chart to resize itself whenever its parent container size changes. If not set the default value is true.- Parameters:
autoResize
- auto resize option- Returns:
- chart model
-
getBackgroundAlpha
Double getBackgroundAlpha()- Returns:
- opacity of background
-
setBackgroundAlpha
Sets opacity of background. Set it to greater 0 value if you wantAbstractChart.backgroundColor
to work. If not set the default value is 0.- Parameters:
backgroundAlpha
- background alpha option- Returns:
- chart model
-
getLanguage
String getLanguage()- Returns:
- language
-
setLanguage
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")
.- Parameters:
language
- language string- Returns:
- chart model
-
getPath
String getPath()- Returns:
- path
-
setPath
Specifies absolute or relative path to amCharts files.- Parameters:
path
- the path string- Returns:
- chart model
-
getSvgIcons
Boolean getSvgIcons()- Returns:
- true if using SVG icons is enabled
-
setSvgIcons
Sets use SVG icons (if browser supports SVG). If not set the default value is true.- Parameters:
svgIcons
- svgIcons option- Returns:
- chart model
-
getTapToActivate
Boolean getTapToActivate()- Returns:
- true if tap to activate is enabled
-
setTapToActivate
Charts which require gestures like swipe (charts with scrollbar/cursor) used to prevent regular page scrolling and could result page to stick to the same spot if the chart occupied whole screen. Now, in order these gestures to start working user has to touch the chart once. Regular touch events like touching on the bar/slice area do not require the first tap and will show balloons and perform other tasks as usual. If you have a chart which occupies full screen and your page does not require scrolling, set tapToActivate to false – this will bring old behavior back. If not set the default value is true.- Parameters:
tapToActivate
- tap to activate option- Returns:
- chart model
-
getDefs
String getDefs()- Returns:
- defs
-
setDefs
Sets any additional information to SVG, like SVG filters or clip paths. The structure of this object should be identical to XML structure of a object you are adding, only in JSON format.- Parameters:
defs
- defs string- Returns:
- chart model
-
getAccessible
Boolean getAccessible()- Returns:
- true if accessible is enabled
-
setAccessible
When enabled, chart adds aria-label attributes to columns or bullets objects. You can control values of these labels using properties likeAbstractGraph.accessibleLabel
. If not set the default value is true.- Parameters:
accessible
- accessible option- Returns:
- chart model
-
getAccessibleTitle
String getAccessibleTitle()- Returns:
- description of a SVG element
-
setAccessibleTitle
Description which is added to of a SVG element.- Parameters:
accessibleTitle
- accessible title string- Returns:
- chart model
-
getResponsive
Responsive getResponsive()- Returns:
- responsive
-
setResponsive
Sets a config object for Responsive plugin- Parameters:
responsive
- the responsive- Returns:
- chart model
-
getProcessCount
Integer getProcessCount()- Returns:
- process count
-
setProcessCount
If processTimeout is greater than 0, 1000 data items will be parsed at a time, then the chart will make pause and continue parsing data until it finishes. If not set the default value is 1000.- Parameters:
processCount
- the process count- Returns:
- chart model
-
getProcessTimeout
Integer getProcessTimeout()- Returns:
- process timeout
-
setProcessTimeout
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.- Parameters:
processTimeout
- the process timeout- Returns:
- chart model
-
getTouchClickDuration
Integer getTouchClickDuration()- Returns:
- touch click duration in milliseconds
-
setTouchClickDuration
@StudioProperty(defaultValue="0") @PositiveOrZero T setTouchClickDuration(Integer touchClickDuration) Sets the touch click duration. If you set it to 200 (milliseconds) or so, the chart will fire GraphItemClickEvent or SliceClickEvent only if user holds his/her finger for 0.2 seconds (200 ms) on the column/bullet/slice object. If not set the default value is 0.- Parameters:
touchClickDuration
- the touch click duration in milliseconds- Returns:
- chart model
-
getAutoTransform
Boolean getAutoTransform()- Returns:
- true if auto transform is enabled,
-
setAutoTransform
If you set it to true and your chart div (or any of the parent div) has CSS scale applied, the chart will position mouse at a correct position. This operation consumes some CPU and quite a few people are using CSS transforms. If not set the default value is false.- Parameters:
autoTransform
- auto transform option- Returns:
- chart model
-
getAccessibleDescription
String getAccessibleDescription()- Returns:
- accessible description string
-
setAccessibleDescription
Description which will be added to node of SVG element.- Parameters:
accessibleDescription
- description string- Returns:
- chart model
-