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 SummaryModifier 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) Setslabeltick opacity.setLabelTickColor(Color labelTickColor) Setslabeltick 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.ChartModeladdAdditionalFields, 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, setUsePrefixesMethods inherited from interface io.jmix.charts.model.HasMarginsgetMarginBottom, getMarginLeft, getMarginRight, getMarginTop, setMarginBottom, setMarginLeft, setMarginRight, setMarginTopMethods inherited from interface io.jmix.charts.model.animation.HasStartEffectgetStartDuration, getStartEffect, setStartDuration, setStartEffect
- 
Method Details- 
getAlphaDouble getAlpha()- Returns:
- opacity of all slices
 
- 
setAlphaSets opacity of all slices. If not set the default value is 1.- Parameters:
- alpha- opacity of all slices
- Returns:
- sliced chart model
 
- 
getAlphaFieldString getAlphaField()- Returns:
- alpha field name
 
- 
setAlphaFieldSets alpha field name from data provider which holds slice's alpha.- Parameters:
- alphaField- alpha field string
- Returns:
- sliced chart model
 
- 
getBaseColorColor getBaseColor()- Returns:
- color of the first slice
 
- 
setBaseColorSets 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
 
- 
getColorFieldString getColorField()- Returns:
- color field
 
- 
setColorFieldSets name of the field from data provider which holds slice's color.- Parameters:
- colorField- color field string
- Returns:
- sliced chart model
 
- 
getDescriptionFieldString getDescriptionField()- Returns:
- description field
 
- 
setDescriptionFieldSets 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
 
- 
setGradientRatioSets 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
 
- 
addGradientRatioAdds gradient ratios.- Parameters:
- ratios- the ratios
- Returns:
- sliced chart model
 
- 
getGroupedAlphaDouble getGroupedAlpha()- Returns:
- opacity of the group slice
 
- 
setGroupedAlphaSets 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
 
- 
getGroupedColorColor getGroupedColor()- Returns:
- grouped color
 
- 
setGroupedColorSets 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
 
- 
getGroupedDescriptionString getGroupedDescription()- Returns:
- grouped description
 
- 
setGroupedDescriptionSets description of the group slice.- Parameters:
- groupedDescription- grouped description string
- Returns:
- sliced chart model
 
- 
getGroupedPulledBoolean getGroupedPulled()- Returns:
- true if grouped pulled is enabled
 
- 
setGroupedPulledIf 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
 
- 
getGroupedTitleString getGroupedTitle()- Returns:
- grouped title
 
- 
setGroupedTitleSets title of the group slice. If not set the default value is "Other".- Parameters:
- groupedTitle- grouped title string
- Returns:
- sliced chart model
 
- 
getGroupPercentDouble getGroupPercent()
- 
setGroupPercentSets 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
 
- 
getHideLabelsPercentDouble getHideLabelsPercent()- Returns:
- hide labels percent
 
- 
setHideLabelsPercentSets 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
 
- 
getHoverAlphaDouble getHoverAlpha()- Returns:
- opacity of a hovered slice
 
- 
setHoverAlphaSets 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
 
- 
getLabelsEnabledBoolean getLabelsEnabled()- Returns:
- true if data labels are visible
 
- 
setLabelsEnabledSet 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
 
- 
getLabelTickAlphaDouble getLabelTickAlpha()- Returns:
- labeltick opacity
 
- 
setLabelTickAlphaSetslabeltick opacity. Value range is 0 - 1. If not set the default value is 0.2.- Parameters:
- labelTickAlpha- label tick opacity
- Returns:
- sliced chart model
 
- 
getLabelTickColorColor getLabelTickColor()- Returns:
- labeltick color
 
- 
setLabelTickColorSetslabeltick color. If not set the default value is #000000.- Parameters:
- labelTickColor- label tick color
- Returns:
- sliced chart model
 
- 
getOutlineAlphaDouble getOutlineAlpha()- Returns:
- outline opacity
 
- 
setOutlineAlphaSets outline opacity. Value range is 0 - 1. If not set the default value is 0.- Parameters:
- outlineAlpha- outline opacity
- Returns:
- sliced chart model
 
- 
getOutlineColorColor getOutlineColor()- Returns:
- outline color
 
- 
setOutlineColorSets outline color. If not set the default value is #FFFFFF.- Parameters:
- outlineColor- the outline color
- Returns:
- sliced chart model
 
- 
getOutlineThicknessInteger getOutlineThickness()- Returns:
- outline thickness
 
- 
setOutlineThicknessSets pie outline thickness. If not set the default value is 1.- Parameters:
- outlineThickness- the outline thickness
- Returns:
- sliced chart model
 
- 
getPatternFieldString getPatternField()- Returns:
- pattern field name
 
- 
setPatternFieldSets field name from your data provider which holds pattern information.- Parameters:
- patternField- pattern field string
- Returns:
- sliced chart model
 
- 
getPulledFieldString getPulledField()- Returns:
- pulled field name
 
- 
setPulledFieldSets 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
 
- 
getPullOutDurationInteger getPullOutDuration()- Returns:
- pull out duration in seconds
 
- 
setPullOutDurationSets pull out duration in seconds. If not set the default value is 1.- Parameters:
- pullOutDuration- pull out duration in seconds
- Returns:
- sliced chart model
 
- 
getPullOutEffectAnimationEffect getPullOutEffect()- Returns:
- pull out effect
 
- 
setPullOutEffectSets 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
 
- 
getPullOutOnlyOneBoolean getPullOutOnlyOne()- Returns:
- true if only one slice can be pulled out at a time
 
- 
setPullOutOnlyOneIf 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
 
- 
getSequencedAnimationBoolean getSequencedAnimation()- Returns:
- true if the animation should be sequenced
 
- 
setSequencedAnimationSpecifies 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
 
- 
getStartAlphaDouble getStartAlpha()- Returns:
- initial opacity of all slices
 
- 
setStartAlphaSets 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
 
- 
getTitleFieldString getTitleField()- Returns:
- title field name
 
- 
setTitleFieldSets name of the field from data provider which holds slice's title.- Parameters:
- titleField- title field string
- Returns:
- sliced chart model
 
- 
getUrlFieldString getUrlField()- Returns:
- the URL field name
 
- 
setUrlFieldSets 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
 
- 
getUrlTargetString 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
 
- 
getValueFieldString getValueField()- Returns:
- value field name
 
- 
setValueFieldSets name of the field from data provider which holds slice's value.- Parameters:
- valueField- value field string
- Returns:
- sliced chart model
 
- 
getVisibleInLegendFieldString 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
 
- 
getLabelFunctionJsFunction getLabelFunction()- Returns:
- label function
 
- 
setLabelFunctionSets 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
 
- 
getMaxLabelWidthInteger getMaxLabelWidth()- Returns:
- maximum label width
 
- 
setMaxLabelWidthSets 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
 
- 
getClassNameFieldString getClassNameField()- Returns:
- class name field
 
- 
setClassNameFieldSets field name from your data provider which holds CSS class name. If this field is set andAbstractChart.addClassNamesis enabled, the slice element will have this class name set.- Parameters:
- classNameField- class name field string
- Returns:
- sliced chart model
 
- 
getShowZeroSlicesBoolean getShowZeroSlices()- Returns:
- true if the chart displays outlines (if visible) and labels for slices even if their value is 0.
 
- 
setShowZeroSlicesSet 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
 
- 
getAccessibleLabelString 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.tabIndexis 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
 
- 
getLabelColorFieldColor getLabelColorField()- Returns:
- label color field
 
- 
setLabelColorFieldSets 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
 
- 
getTabIndexInteger getTabIndex()- Returns:
- tab index
 
- 
setTabIndexIn 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
 
 
-