Package io.jmix.charts.model.chart
Interface SlicedChartModel<T extends SlicedChartModel>
- All Superinterfaces:
ChartModel<T>
,HasColors<T>
,HasMargins<T>
,HasStartEffect<T>
- All Known Subinterfaces:
FunnelChart
,FunnelChartModel<T>
,PieChart
,PieChartModel<T>
,SlicedChart<T>
- All Known Implementing Classes:
FunnelChartImpl
,FunnelChartModelImpl
,PieChartImpl
,PieChartModelImpl
,SlicedChartImpl
,SlicedChartModelImpl
public interface SlicedChartModel<T extends SlicedChartModel>
extends ChartModel<T>, HasMargins<T>, HasStartEffect<T>, HasColors<T>
-
Method Summary
Modifier and TypeMethodDescriptionaddGradientRatio
(Double... ratios) Adds gradient ratios.getAlpha()
setAccessibleLabel
(String accessibleLabel) Sets accessible label text.Sets opacity of all slices.setAlphaField
(String alphaField) Sets alpha field name from data provider which holds slice's alpha.setBaseColor
(Color baseColor) Sets color of the first slice.setClassNameField
(String classNameField) Sets field name from your data provider which holds CSS class name.setColorField
(String colorField) Sets name of the field from data provider which holds slice's color.setDescriptionField
(String descriptionField) Sets name of the field from data provider which holds a string with description.setGradientRatio
(List<Double> gradientRatio) Sets the list of gradient ratio.setGroupedAlpha
(Double groupedAlpha) Sets opacity of the group slice.setGroupedColor
(Color groupedColor) Sets the color of the group slice.setGroupedDescription
(String groupedDescription) Sets description of the group slice.setGroupedPulled
(Boolean groupedPulled) If groupedPulled set to true, the group slice will be pulled out when the chart loads.setGroupedTitle
(String groupedTitle) Sets title of the group slice.setGroupPercent
(Double groupPercent) Sets group percent.setHideLabelsPercent
(Double hideLabelsPercent) Sets hide labels percent.setHoverAlpha
(Double hoverAlpha) Sets opacity of a hovered slice.setLabelColorField
(Color labelColorField) Sets a field from your data provider which holds color value for the tick.setLabelFunction
(JsFunction labelFunction) Sets label function that can format data labels in any way you want.setLabelsEnabled
(Boolean labelsEnabled) Set labelsEnabled to true if data labels should be visible.setLabelTickAlpha
(Double labelTickAlpha) Setslabel
tick opacity.setLabelTickColor
(Color labelTickColor) Setslabel
tick color.setMaxLabelWidth
(Integer maxLabelWidth) Sets maximum label width.setOutlineAlpha
(Double outlineAlpha) Sets outline opacity.setOutlineColor
(Color outlineColor) Sets outline color.setOutlineThickness
(Integer outlineThickness) Sets pie outline thickness.setPatternField
(String patternField) Sets field name from your data provider which holds pattern information.setPulledField
(String pulledField) Sets name of the field in chart's data provider which holds a boolean value telling the chart whether this slice must be pulled or not.setPullOutDuration
(Integer pullOutDuration) Sets pull out duration in seconds.setPullOutEffect
(AnimationEffect pullOutEffect) Sets pull out effect.setPullOutOnlyOne
(Boolean pullOutOnlyOne) If pullOutOnlyOne set to true, only one slice can be pulled out at a time.setSequencedAnimation
(Boolean sequencedAnimation) Specifies whether the animation should be sequenced or all slices should appear at once.setShowZeroSlices
(Boolean showZeroSlices) Set showZeroSlices to true if you want the chart should display outlines (if visible) and labels for slices even if their value is 0.setStartAlpha
(Double startAlpha) Sets initial opacity of all slices.setTabIndex
(Integer tabIndex) In case you set it to some number, the chart will set focus on a slice (starting from first) when user clicks tab key.setTitleField
(String titleField) Sets name of the field from data provider which holds slice's title.setUrlField
(String urlField) Sets name of the field from data provider which holds URL which would be accessed if the user clicks on a slice.setUrlTarget
(String urlTarget) If URL is specified for a slice, it will be opened when user clicks on it.setValueField
(String valueField) Sets name of the field from data provider which holds slice's value.setVisibleInLegendField
(String visibleInLegendField) Use this field to selectively specify which slice is shown in legend.Methods inherited from interface io.jmix.charts.model.chart.ChartModel
addAdditionalFields, addData, addLabels, addPrefixesOfBigNumbers, addPrefixesOfSmallNumbers, addTitles, getAccessible, getAccessibleDescription, getAccessibleTitle, getAddClassNames, getAdditionalFields, getAllLabels, getAutoDisplay, getAutoResize, getAutoTransform, getBackgroundAlpha, getBackgroundColor, getBalloon, getBorderAlpha, getBorderColor, getClassNamePrefix, getColor, getCreditsPosition, getDataProvider, getDecimalSeparator, getDefs, getExport, getFontFamily, getFontSize, getHandDrawn, getHandDrawScatter, getHandDrawThickness, getHideBalloonTime, getLanguage, getLegend, getPanEventsEnabled, getPath, getPathToImages, getPercentPrecision, getPrecision, getPrefixesOfBigNumbers, getPrefixesOfSmallNumbers, getProcessCount, getProcessTimeout, getResponsive, getSvgIcons, getTapToActivate, getTheme, getThousandsSeparator, getTitles, getTouchClickDuration, getUsePrefixes, setAccessible, setAccessibleDescription, setAccessibleTitle, setAddClassNames, setAdditionalFields, setAllLabels, setAutoDisplay, setAutoResize, setAutoTransform, setBackgroundAlpha, setBackgroundColor, setBalloon, setBorderAlpha, setBorderColor, setClassNamePrefix, setColor, setCreditsPosition, setDataProvider, setDecimalSeparator, setDefs, setExport, setFontFamily, setFontSize, setHandDrawn, setHandDrawScatter, setHandDrawThickness, setHideBalloonTime, setLanguage, setLegend, setPanEventsEnabled, setPath, setPathToImages, setPercentPrecision, setPrecision, setPrefixesOfBigNumbers, setPrefixesOfSmallNumbers, setProcessCount, setProcessTimeout, setResponsive, setSvgIcons, setTapToActivate, setTheme, setThousandsSeparator, setTitles, setTouchClickDuration, setUsePrefixes
Methods inherited from interface io.jmix.charts.model.HasMargins
getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop
Methods inherited from interface io.jmix.charts.model.animation.HasStartEffect
getStartDuration, getStartEffect, setStartDuration, setStartEffect
-
Method Details
-
getAlpha
Double getAlpha()- Returns:
- opacity of all slices
-
setAlpha
Sets opacity of all slices. If not set the default value is 1.- Parameters:
alpha
- opacity of all slices- Returns:
- sliced chart model
-
getAlphaField
String getAlphaField()- Returns:
- alpha field name
-
setAlphaField
Sets alpha field name from data provider which holds slice's alpha.- Parameters:
alphaField
- alpha field string- Returns:
- sliced chart model
-
getBaseColor
Color getBaseColor()- Returns:
- color of the first slice
-
setBaseColor
Sets color of the first slice. All the other will be colored with darker or brighter colors. Use brightnessStep to set intensity of color change for each subsequent slice. If not set the default value is 20.- Parameters:
baseColor
- color of the first slice- Returns:
- sliced chart model
-
getColorField
String getColorField()- Returns:
- color field
-
setColorField
Sets name of the field from data provider which holds slice's color.- Parameters:
colorField
- color field string- Returns:
- sliced chart model
-
getDescriptionField
String getDescriptionField()- Returns:
- description field
-
setDescriptionField
Sets name of the field from data provider which holds a string with description.- Parameters:
descriptionField
- description field string- Returns:
- sliced chart model
-
getGradientRatio
- Returns:
- list of gradient ratio
-
setGradientRatio
Sets the list of gradient ratio. Will make slices to be filled with color gradients. Negative value means the color will be darker than the original, and positive number means the color will be lighter.- Parameters:
gradientRatio
- list of gradient ratio- Returns:
- sliced chart model
-
addGradientRatio
Adds gradient ratios.- Parameters:
ratios
- the ratios- Returns:
- sliced chart model
-
getGroupedAlpha
Double getGroupedAlpha()- Returns:
- opacity of the group slice
-
setGroupedAlpha
Sets opacity of the group slice. Value range is 0 - 1. If not set the default value is 1.- Parameters:
groupedAlpha
- opacity of the group slice- Returns:
- sliced chart model
-
getGroupedColor
Color getGroupedColor()- Returns:
- grouped color
-
setGroupedColor
Sets the color of the group slice. The default value is not set - this means the next available color from "colors" list will be used.- Parameters:
groupedColor
- grouped color- Returns:
- sliced chart model
-
getGroupedDescription
String getGroupedDescription()- Returns:
- grouped description
-
setGroupedDescription
Sets description of the group slice.- Parameters:
groupedDescription
- grouped description string- Returns:
- sliced chart model
-
getGroupedPulled
Boolean getGroupedPulled()- Returns:
- true if grouped pulled is enabled
-
setGroupedPulled
If groupedPulled set to true, the group slice will be pulled out when the chart loads. If not set the default value is false.- Parameters:
groupedPulled
- grouped pulled option- Returns:
- sliced chart model
-
getGroupedTitle
String getGroupedTitle()- Returns:
- grouped title
-
setGroupedTitle
Sets title of the group slice. If not set the default value is "Other".- Parameters:
groupedTitle
- grouped title string- Returns:
- sliced chart model
-
getGroupPercent
Double getGroupPercent() -
setGroupPercent
Sets group percent. If there is more than one slice whose percentage of the pie is less than this number, those slices will be grouped together into one slice. This is the "other" slice. It will always be the last slice in a pie. If not set the default value is 0.- Parameters:
groupPercent
- the group percent- Returns:
- sliced chart model
-
getHideLabelsPercent
Double getHideLabelsPercent()- Returns:
- hide labels percent
-
setHideLabelsPercent
Sets hide labels percent. Slices with percent less then hideLabelsPercent won't display labels. This is useful to avoid cluttering up the chart, if you have a lot of small slices. 0 means all labels will be shown. If not set the default value is 0.- Parameters:
hideLabelsPercent
- the hide labels percent- Returns:
- sliced chart model
-
getHoverAlpha
Double getHoverAlpha()- Returns:
- opacity of a hovered slice
-
setHoverAlpha
Sets opacity of a hovered slice. Value range is 0 - 1. If not set the default value is 1.- Parameters:
hoverAlpha
- opacity of a hovered slice- Returns:
- sliced chart model
-
getLabelsEnabled
Boolean getLabelsEnabled()- Returns:
- true if data labels are visible
-
setLabelsEnabled
Set labelsEnabled to true if data labels should be visible. If not set the default value is true.- Parameters:
labelsEnabled
- labels enabled option- Returns:
- sliced chart model
-
getLabelTickAlpha
Double getLabelTickAlpha()- Returns:
label
tick opacity
-
setLabelTickAlpha
Setslabel
tick opacity. Value range is 0 - 1. If not set the default value is 0.2.- Parameters:
labelTickAlpha
- label tick opacity- Returns:
- sliced chart model
-
getLabelTickColor
Color getLabelTickColor()- Returns:
label
tick color
-
setLabelTickColor
Setslabel
tick color. If not set the default value is #000000.- Parameters:
labelTickColor
- label tick color- Returns:
- sliced chart model
-
getOutlineAlpha
Double getOutlineAlpha()- Returns:
- outline opacity
-
setOutlineAlpha
Sets outline opacity. Value range is 0 - 1. If not set the default value is 0.- Parameters:
outlineAlpha
- outline opacity- Returns:
- sliced chart model
-
getOutlineColor
Color getOutlineColor()- Returns:
- outline color
-
setOutlineColor
Sets outline color. If not set the default value is #FFFFFF.- Parameters:
outlineColor
- the outline color- Returns:
- sliced chart model
-
getOutlineThickness
Integer getOutlineThickness()- Returns:
- outline thickness
-
setOutlineThickness
Sets pie outline thickness. If not set the default value is 1.- Parameters:
outlineThickness
- the outline thickness- Returns:
- sliced chart model
-
getPatternField
String getPatternField()- Returns:
- pattern field name
-
setPatternField
Sets field name from your data provider which holds pattern information.- Parameters:
patternField
- pattern field string- Returns:
- sliced chart model
-
getPulledField
String getPulledField()- Returns:
- pulled field name
-
setPulledField
Sets name of the field in chart's data provider which holds a boolean value telling the chart whether this slice must be pulled or not.- Parameters:
pulledField
- pulled field string- Returns:
- sliced chart model
-
getPullOutDuration
Integer getPullOutDuration()- Returns:
- pull out duration in seconds
-
setPullOutDuration
Sets pull out duration in seconds. If not set the default value is 1.- Parameters:
pullOutDuration
- pull out duration in seconds- Returns:
- sliced chart model
-
getPullOutEffect
AnimationEffect getPullOutEffect()- Returns:
- pull out effect
-
setPullOutEffect
Sets pull out effect. Possible values are: easeOutSine, easeInSine, elastic, bounce. If not set the default value is BOUNCE.- Parameters:
pullOutEffect
- the pull out effect- Returns:
- sliced chart model
-
getPullOutOnlyOne
Boolean getPullOutOnlyOne()- Returns:
- true if only one slice can be pulled out at a time
-
setPullOutOnlyOne
If pullOutOnlyOne set to true, only one slice can be pulled out at a time. If the viewer clicks on a slice, any other pulled-out slice will be pulled in. If not set the default value is false.- Parameters:
pullOutOnlyOne
- pull out only one option- Returns:
- sliced chart model
-
getSequencedAnimation
Boolean getSequencedAnimation()- Returns:
- true if the animation should be sequenced
-
setSequencedAnimation
Specifies whether the animation should be sequenced or all slices should appear at once. If not set the default value is true.- Parameters:
sequencedAnimation
- sequenced animation option- Returns:
- sliced chart model
-
getStartAlpha
Double getStartAlpha()- Returns:
- initial opacity of all slices
-
setStartAlpha
Sets initial opacity of all slices. Slices will fade in from startAlpha. If not set the default value is 0.- Parameters:
startAlpha
- initial opacity of all slices- Returns:
- sliced chart model
-
getTitleField
String getTitleField()- Returns:
- title field name
-
setTitleField
Sets name of the field from data provider which holds slice's title.- Parameters:
titleField
- title field string- Returns:
- sliced chart model
-
getUrlField
String getUrlField()- Returns:
- the URL field name
-
setUrlField
Sets name of the field from data provider which holds URL which would be accessed if the user clicks on a slice.- Parameters:
urlField
- the URL field string- Returns:
- sliced chart model
-
getUrlTarget
String getUrlTarget()- Returns:
- the URL target
-
setUrlTarget
@StudioProperty(type=OPTIONS, options={"_blank","_parent","_self","_top"}, defaultValue="_self") T setUrlTarget(String urlTarget) If URL is specified for a slice, it will be opened when user clicks on it. urlTarget specifies target of this URL. Use "_blank" if you want URL to be opened in a new window. If not set the default value is "_self".- Parameters:
urlTarget
- the URL target string- Returns:
- sliced chart model
-
getValueField
String getValueField()- Returns:
- value field name
-
setValueField
Sets name of the field from data provider which holds slice's value.- Parameters:
valueField
- value field string- Returns:
- sliced chart model
-
getVisibleInLegendField
String getVisibleInLegendField()- Returns:
- visible in legend field
-
setVisibleInLegendField
@StudioProperty(type=PROPERTY_PATH_REF, options="boolean") T setVisibleInLegendField(String visibleInLegendField) Use this field to selectively specify which slice is shown in legend. It should be set to a boolean field in data (that holds either true or false). For example if you set visibleInLegendField to "showInLegend", all slices that have "showInLegend: false" in their data will not be shown in the legend.- Parameters:
visibleInLegendField
- visible in legend field string- Returns:
- sliced chart model
-
getLabelFunction
JsFunction getLabelFunction()- Returns:
- label function
-
setLabelFunction
Sets label function that can format data labels in any way you want. Chart will call this method and will pass Slice object and formatted text as attributes. This function should return string which will be displayed as label.- Parameters:
labelFunction
- label function- Returns:
- sliced chart model
-
getMaxLabelWidth
Integer getMaxLabelWidth()- Returns:
- maximum label width
-
setMaxLabelWidth
Sets maximum label width. If width of the label is bigger than maxLabelWidth, it will be wrapped. If not set the default value is 200.- Parameters:
maxLabelWidth
- maximum label width- Returns:
- sliced chart model
-
getClassNameField
String getClassNameField()- Returns:
- class name field
-
setClassNameField
Sets field name from your data provider which holds CSS class name. If this field is set andAbstractChart.addClassNames
is enabled, the slice element will have this class name set.- Parameters:
classNameField
- class name field string- Returns:
- sliced chart model
-
getShowZeroSlices
Boolean getShowZeroSlices()- Returns:
- true if the chart displays outlines (if visible) and labels for slices even if their value is 0.
-
setShowZeroSlices
Set showZeroSlices to true if you want the chart should display outlines (if visible) and labels for slices even if their value is 0. If not set the default value is false.- Parameters:
showZeroSlices
- show zero slices option- Returns:
- sliced chart model
-
getAccessibleLabel
String getAccessibleLabel()- Returns:
- accessible label text
-
setAccessibleLabel
@StudioProperty(type=LOCALIZED_STRING, defaultValue="[[title]]: [[percents]]% [[value]] [[description]]") T setAccessibleLabel(String accessibleLabel) Sets accessible label text. It will be read by screen readers if user rolls-over the slice or sets focus using tab key (this is possible only ifSlicedChartModelImpl.tabIndex
is set to some number). Text is added as aria-label tag. Note, not all screen readers and browsers support this. If not set the default value is "[[title]]: [[percents]]% [[value]] [[description]]".- Parameters:
accessibleLabel
- accessible label text- Returns:
- sliced chart model
-
getLabelColorField
Color getLabelColorField()- Returns:
- label color field
-
setLabelColorField
Sets a field from your data provider which holds color value for the tick. Use it to set color of the label for each slice individually. If not set the default value is #000000.- Parameters:
labelColorField
- label color field string- Returns:
- sliced chart model
-
getTabIndex
Integer getTabIndex()- Returns:
- tab index
-
setTabIndex
In case you set it to some number, the chart will set focus on a slice (starting from first) when user clicks tab key. When a focus is set, screen readers like NVDA Screen reader will read label which is set usingSlicedChartModelImpl.accessibleLabel
. Note, not all browsers and readers support this.- Parameters:
tabIndex
- the tab index- Returns:
- sliced chart model
-