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 Details

    • getAlpha

      Double getAlpha()
      Returns:
      opacity of all slices
    • setAlpha

      @StudioProperty(defaultValue="1") @Max(1L) @Min(0L) T setAlpha(Double alpha)
      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

      @StudioProperty(type=PROPERTY_PATH_REF) T setAlphaField(String alphaField)
      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

      @StudioProperty(type=OPTIONS) T setBaseColor(Color baseColor)
      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

      @StudioProperty(type=PROPERTY_PATH_REF) T setColorField(String colorField)
      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

      @StudioProperty(type=PROPERTY_PATH_REF) T setDescriptionField(String descriptionField)
      Sets name of the field from data provider which holds a string with description.
      Parameters:
      descriptionField - description field string
      Returns:
      sliced chart model
    • getGradientRatio

      List<Double> getGradientRatio()
      Returns:
      list of gradient ratio
    • setGradientRatio

      T setGradientRatio(List<Double> gradientRatio)
      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

      T addGradientRatio(Double... ratios)
      Adds gradient ratios.
      Parameters:
      ratios - the ratios
      Returns:
      sliced chart model
    • getGroupedAlpha

      Double getGroupedAlpha()
      Returns:
      opacity of the group slice
    • setGroupedAlpha

      @StudioProperty(defaultValue="1") @Max(1L) @Min(0L) T setGroupedAlpha(Double groupedAlpha)
      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

      @StudioProperty(type=OPTIONS) T setGroupedColor(Color groupedColor)
      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

      @StudioProperty T setGroupedDescription(String groupedDescription)
      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

      @StudioProperty(defaultValue="false") T setGroupedPulled(Boolean groupedPulled)
      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

      @StudioProperty(defaultValue="Other") T setGroupedTitle(String groupedTitle)
      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

      @StudioProperty(defaultValue="0") T setGroupPercent(Double groupPercent)
      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

      @StudioProperty(defaultValue="0") T setHideLabelsPercent(Double hideLabelsPercent)
      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

      @StudioProperty(defaultValue="1") @Max(1L) @Min(0L) T setHoverAlpha(Double hoverAlpha)
      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

      @StudioProperty(defaultValue="true") T setLabelsEnabled(Boolean labelsEnabled)
      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

      @StudioProperty(defaultValue="0.2") @Max(1L) @Min(0L) T setLabelTickAlpha(Double labelTickAlpha)
      Sets label 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

      @StudioProperty(type=OPTIONS, defaultValue="#000000") T setLabelTickColor(Color labelTickColor)
      Sets label 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

      @StudioProperty(defaultValue="0") @Max(1L) @Min(0L) T setOutlineAlpha(Double outlineAlpha)
      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

      @StudioProperty(type=OPTIONS, defaultValue="#FFFFFF") T setOutlineColor(Color outlineColor)
      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

      @StudioProperty(defaultValue="1") T setOutlineThickness(Integer outlineThickness)
      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

      @StudioProperty(type=PROPERTY_PATH_REF) T setPatternField(String patternField)
      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

      @StudioProperty(type=PROPERTY_PATH_REF, options="boolean") T 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.
      Parameters:
      pulledField - pulled field string
      Returns:
      sliced chart model
    • getPullOutDuration

      Integer getPullOutDuration()
      Returns:
      pull out duration in seconds
    • setPullOutDuration

      @StudioProperty(defaultValue="1") T setPullOutDuration(Integer pullOutDuration)
      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

      T setPullOutEffect(AnimationEffect pullOutEffect)
      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

      @StudioProperty(defaultValue="false") T setPullOutOnlyOne(Boolean pullOutOnlyOne)
      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

      @StudioProperty(defaultValue="true") T setSequencedAnimation(Boolean sequencedAnimation)
      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

      @StudioProperty(defaultValue="0") T setStartAlpha(Double startAlpha)
      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

      @StudioProperty(type=PROPERTY_PATH_REF) T setTitleField(String titleField)
      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

      @StudioProperty(type=PROPERTY_PATH_REF) T 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.
      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

      @StudioProperty(type=PROPERTY_PATH_REF) T setValueField(String valueField)
      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

      T setLabelFunction(JsFunction labelFunction)
      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

      @StudioProperty(defaultValue="200") T setMaxLabelWidth(Integer maxLabelWidth)
      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

      @StudioProperty(type=PROPERTY_PATH_REF) T setClassNameField(String classNameField)
      Sets field name from your data provider which holds CSS class name. If this field is set and AbstractChart.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

      @StudioProperty(defaultValue="false") T 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. 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 if SlicedChartModelImpl.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

      @StudioProperty(type=OPTIONS, defaultValue="#000000") T setLabelColorField(Color labelColorField)
      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

      @StudioProperty T 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. When a focus is set, screen readers like NVDA Screen reader will read label which is set using SlicedChartModelImpl.accessibleLabel. Note, not all browsers and readers support this.
      Parameters:
      tabIndex - the tab index
      Returns:
      sliced chart model