Package org.pepstock.charba.client.items
Class DatasetElementOptions
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.items.DatasetElementOptions
-
public final class DatasetElementOptions extends NativeObjectContainer
This item provides all information about the view where a dataset has been displayed.
This object has been created and passed to event handler or callbacks to apply own logic.
This is a wrapper of the CHART.JS item with all needed info.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TooltipLabelColorcreateTooltipLabelColor()Create newTooltipLabelColorfilling it with background and border color of dataset element.TooltipLabelPointStylecreateTooltipLabelPointStyle()Create newTooltipLabelPointStylefilling it with point style and rotation of dataset element.doublegetAngle()Returns the arc angle to cover.ArcBorderRadiusgetArcBorderRadius()Returns the border radius of the dataset item in pixels asArcBorderRadius.IsColorgetBackgroundColor()Returns the background color of the dataset item.CanvasGradientItemgetBackgroundColorAsCanvasGradient()Returns the background color as canvas gradient.CanvasPatternItemgetBackgroundColorAsCanvasPattern()Returns the background color as canvas pattern.GradientgetBackgroundColorAsGradient()Returns the background color as gradient.PatterngetBackgroundColorAsPattern()Returns the background color as pattern.StringgetBackgroundColorAsString()Returns the background color of the dataset item.BarBorderRadiusgetBarBorderRadius()Returns the border radius of the dataset item in pixels asBarBorderRadius.doublegetBarPercentage()Returns the percent (0-1) of the available width each bar should be within the category width.BorderAligngetBorderAlign()Returns the property to set the border alignment on chart datasets.CapStylegetBorderCapStyle()Returns how the end points of every line are drawn.IsColorgetBorderColor()Returns the color of the dataset item borderCanvasGradientItemgetBorderColorAsCanvasGradient()Returns the border color as canvas gradient.GradientgetBorderColorAsGradient()Returns the border color as gradient.StringgetBorderColorAsString()Returns the color of the dataset item borderList<Integer>getBorderDash()Returns the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.doublegetBorderDashOffset()Returns the line dash pattern offset.JoinStylegetBorderJoinStyle()Returns how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).intgetBorderRadius()Returns the bar border radius (in pixels).BorderSkippedgetBorderSkipped()Returns the edge to skip drawing the border for.intgetBorderWidth()Returns the border width of the dataset item in pixels.BarBorderWidthgetBorderWidthAsObject()Returns the border width of the dataset item in pixels asBarBorderWidth.doublegetCategoryPercentage()Returns the percent (0-1) of the available width each category should be within the sample width.CubicInterpolationModegetCubicInterpolationMode()Returns algorithm used to interpolate a smooth curve from the discrete data points.IsFillgetFill()Returns how to fill the area under the line.doublegetHitRadius()Returns the pixel size of the non-displayed point that reacts to mouse events.intgetHoverBorderWidth()Returns the border width of point when hovered.doublegetHoverRadius()Returns the radius of the point when hovered.intgetOffset()Returns the arc offset (in pixels).PointStylegetPointStyle()Returns the style of the point.CanvasgetPointStyleAsCanvas()Returns the style of the point as canvas.
If property is missing or not an canvas, returnsnull.ImggetPointStyleAsImage()Returns the style of the point as image.
If property is missing or not an image, returnsnull.PointStyleTypegetPointStyleType()Returns the type of point style.doublegetRadius()Returns the radius of the point.doublegetRotation()Returns the point rotation (in degrees).doublegetTension()Returns the Bézier curve tension (0 for no Bézier curves).doublegetWeight()Returns the relative thickness of the dataset.booleanisBackgroundColorAsColor()Returnstrueif the background color is defined as color.booleanisBackgroundColorAsGradient()Returnstrueif the background color is defined as gradient.booleanisBackgroundColorAsPattern()Returnstrueif the background color is defined as canvas pattern.booleanisBorderColorAsColor()Returnstrueif the border color is defined as color.booleanisBorderColorAsGradient()Returnstrueif the border color is defined as gradient.booleanisBorderRadiusAsObject()Returnstrueif the border width is defined asBarBorderRadius.booleanisBorderWidthAsObject()Returnstrueif the border width is defined asBarBorderWidth.booleanisCapBezierPoints()Returnstrueto keep Bézier control inside the chart,falsefor no restriction.SteppedisStepped()Returns if the line is shown as a stepped line.-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Method Detail
-
isBackgroundColorAsColor
public boolean isBackgroundColorAsColor()
Returnstrueif the background color is defined as color.- Returns:
trueif the background color is defined as color
-
isBackgroundColorAsGradient
public boolean isBackgroundColorAsGradient()
Returnstrueif the background color is defined as gradient.- Returns:
trueif the background color is defined as gradient
-
isBackgroundColorAsPattern
public boolean isBackgroundColorAsPattern()
Returnstrueif the background color is defined as canvas pattern.- Returns:
trueif the background color is defined as canvas pattern
-
getBackgroundColorAsString
public String getBackgroundColorAsString()
Returns the background color of the dataset item.- Returns:
- the background color of the dataset item.
-
getBackgroundColor
public IsColor getBackgroundColor()
Returns the background color of the dataset item.- Returns:
- the background color of the dataset item.
-
getBackgroundColorAsGradient
public Gradient getBackgroundColorAsGradient()
Returns the background color as gradient.- Returns:
- the background color or
nullif is not a gradient
-
getBackgroundColorAsCanvasGradient
public CanvasGradientItem getBackgroundColorAsCanvasGradient()
Returns the background color as canvas gradient.- Returns:
- the background color or
nullif is not a canvas gradient
-
getBackgroundColorAsPattern
public Pattern getBackgroundColorAsPattern()
Returns the background color as pattern.- Returns:
- the background color or
nullif is not a pattern
-
getBackgroundColorAsCanvasPattern
public CanvasPatternItem getBackgroundColorAsCanvasPattern()
Returns the background color as canvas pattern.- Returns:
- the background color or
nullif is not a canvas pattern
-
isBorderWidthAsObject
public boolean isBorderWidthAsObject()
Returnstrueif the border width is defined asBarBorderWidth.- Returns:
trueif the border width is defined asBarBorderWidth
-
getBorderWidth
public int getBorderWidth()
Returns the border width of the dataset item in pixels.- Returns:
- the border width of the dataset item in pixels.
-
getBorderWidthAsObject
public BarBorderWidth getBorderWidthAsObject()
Returns the border width of the dataset item in pixels asBarBorderWidth.- Returns:
- the border width of the dataset item in pixels as
BarBorderWidth.
-
isBorderColorAsColor
public boolean isBorderColorAsColor()
Returnstrueif the border color is defined as color.- Returns:
trueif the border color is defined as color
-
isBorderColorAsGradient
public boolean isBorderColorAsGradient()
Returnstrueif the border color is defined as gradient.- Returns:
trueif the border color is defined as gradient
-
getBorderColorAsString
public String getBorderColorAsString()
Returns the color of the dataset item border- Returns:
- the color of the dataset item border.
-
getBorderColor
public IsColor getBorderColor()
Returns the color of the dataset item border- Returns:
- the color of the dataset item border
-
getBorderColorAsGradient
public Gradient getBorderColorAsGradient()
Returns the border color as gradient.- Returns:
- the border color or
nullif is not a gradient
-
getBorderColorAsCanvasGradient
public CanvasGradientItem getBorderColorAsCanvasGradient()
Returns the border color as canvas gradient.- Returns:
- the border color or
nullif is not a canvas gradient
-
getBarPercentage
public double getBarPercentage()
Returns the percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.- Returns:
- percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.
-
getCategoryPercentage
public double getCategoryPercentage()
Returns the percent (0-1) of the available width each category should be within the sample width.- Returns:
- the percent (0-1) of the available width each category should be within the sample width.
-
getBorderAlign
public BorderAlign getBorderAlign()
Returns the property to set the border alignment on chart datasets.- Returns:
- the property to set the border alignment on chart datasets.
-
getWeight
public double getWeight()
Returns the relative thickness of the dataset.- Returns:
- the relative thickness of the dataset
-
getAngle
public double getAngle()
Returns the arc angle to cover.- Returns:
- the arc angle to cover
-
getOffset
public int getOffset()
Returns the arc offset (in pixels).- Returns:
- the arc offset
-
getBorderSkipped
public BorderSkipped getBorderSkipped()
Returns the edge to skip drawing the border for.- Returns:
- the edge to skip drawing the border for.
-
isBorderRadiusAsObject
public boolean isBorderRadiusAsObject()
Returnstrueif the border width is defined asBarBorderRadius.- Returns:
trueif the border width is defined asBarBorderRadius
-
getBorderRadius
public int getBorderRadius()
Returns the bar border radius (in pixels).- Returns:
- the bar border radius (in pixels).
-
getBarBorderRadius
public BarBorderRadius getBarBorderRadius()
Returns the border radius of the dataset item in pixels asBarBorderRadius.- Returns:
- the border radius of the dataset item in pixels as
BarBorderRadius.
-
getArcBorderRadius
public ArcBorderRadius getArcBorderRadius()
Returns the border radius of the dataset item in pixels asArcBorderRadius.- Returns:
- the border radius of the dataset item in pixels as
ArcBorderRadius.
-
getTension
public double getTension()
Returns the Bézier curve tension (0 for no Bézier curves).- Returns:
- the Bézier curve tension (0 for no Bézier curves).
-
getBorderCapStyle
public CapStyle getBorderCapStyle()
Returns how the end points of every line are drawn.- Returns:
- how the end points of every line are drawn.
-
getBorderDash
public List<Integer> getBorderDash()
Returns the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Returns:
- the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
-
getBorderDashOffset
public double getBorderDashOffset()
Returns the line dash pattern offset.- Returns:
- the line dash pattern offset.
-
getBorderJoinStyle
public JoinStyle getBorderJoinStyle()
Returns how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).- Returns:
- how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together
-
isCapBezierPoints
public boolean isCapBezierPoints()
Returnstrueto keep Bézier control inside the chart,falsefor no restriction.- Returns:
trueto keep Bézier control inside the chart,falsefor no restriction.
-
getCubicInterpolationMode
public CubicInterpolationMode getCubicInterpolationMode()
Returns algorithm used to interpolate a smooth curve from the discrete data points.- Returns:
- algorithm used to interpolate a smooth curve from the discrete data points.
-
isStepped
public Stepped isStepped()
Returns if the line is shown as a stepped line.- Returns:
- If the line is shown as a stepped line.
-
getFill
public IsFill getFill()
Returns how to fill the area under the line.- Returns:
- how to fill the area under the line.
-
getRadius
public double getRadius()
Returns the radius of the point.- Returns:
- the radius of the point
-
getHitRadius
public double getHitRadius()
Returns the pixel size of the non-displayed point that reacts to mouse events.- Returns:
- the pixel size of the non-displayed point.
-
getHoverRadius
public double getHoverRadius()
Returns the radius of the point when hovered.- Returns:
- the radius of the point when hovered.
-
getHoverBorderWidth
public int getHoverBorderWidth()
Returns the border width of point when hovered.- Returns:
- the border width of point when hovered.
-
getRotation
public double getRotation()
Returns the point rotation (in degrees).- Returns:
- the point rotation (in degrees).
-
getPointStyleType
public PointStyleType getPointStyleType()
Returns the type of point style.- Returns:
- the type of point style
-
getPointStyleAsImage
public Img getPointStyleAsImage()
Returns the style of the point as image.
If property is missing or not an image, returnsnull.- Returns:
- image of the style of the point as image.
If property is missing or not a image, returnsnull.
-
getPointStyleAsCanvas
public Canvas getPointStyleAsCanvas()
Returns the style of the point as canvas.
If property is missing or not an canvas, returnsnull.- Returns:
- canvas of the style of the point as canvas.
If property is missing or not a canvas, returnsnull.
-
getPointStyle
public PointStyle getPointStyle()
Returns the style of the point.- Returns:
- the style of the point
-
createTooltipLabelPointStyle
public TooltipLabelPointStyle createTooltipLabelPointStyle()
Create newTooltipLabelPointStylefilling it with point style and rotation of dataset element.- Returns:
- new
TooltipLabelPointStylefilling it with point style and rotation of dataset element
-
createTooltipLabelColor
public TooltipLabelColor createTooltipLabelColor()
Create newTooltipLabelColorfilling it with background and border color of dataset element.- Returns:
- new
TooltipLabelColorfilling it with background and border color of dataset element
-
-