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 TooltipLabelColor
createTooltipLabelColor()
Create newTooltipLabelColor
filling it with background and border color of dataset element.TooltipLabelPointStyle
createTooltipLabelPointStyle()
Create newTooltipLabelPointStyle
filling it with point style and rotation of dataset element.double
getAngle()
Returns the arc angle to cover.ArcBorderRadius
getArcBorderRadius()
Returns the border radius of the dataset item in pixels asArcBorderRadius
.IsColor
getBackgroundColor()
Returns the background color of the dataset item.CanvasGradientItem
getBackgroundColorAsCanvasGradient()
Returns the background color as canvas gradient.CanvasPatternItem
getBackgroundColorAsCanvasPattern()
Returns the background color as canvas pattern.Gradient
getBackgroundColorAsGradient()
Returns the background color as gradient.Pattern
getBackgroundColorAsPattern()
Returns the background color as pattern.String
getBackgroundColorAsString()
Returns the background color of the dataset item.BarBorderRadius
getBarBorderRadius()
Returns the border radius of the dataset item in pixels asBarBorderRadius
.double
getBarPercentage()
Returns the percent (0-1) of the available width each bar should be within the category width.BorderAlign
getBorderAlign()
Returns the property to set the border alignment on chart datasets.CapStyle
getBorderCapStyle()
Returns how the end points of every line are drawn.IsColor
getBorderColor()
Returns the color of the dataset item borderCanvasGradientItem
getBorderColorAsCanvasGradient()
Returns the border color as canvas gradient.Gradient
getBorderColorAsGradient()
Returns the border color as gradient.String
getBorderColorAsString()
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.double
getBorderDashOffset()
Returns the line dash pattern offset.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).int
getBorderRadius()
Returns the bar border radius (in pixels).BorderSkipped
getBorderSkipped()
Returns the edge to skip drawing the border for.int
getBorderWidth()
Returns the border width of the dataset item in pixels.BarBorderWidth
getBorderWidthAsObject()
Returns the border width of the dataset item in pixels asBarBorderWidth
.double
getCategoryPercentage()
Returns the percent (0-1) of the available width each category should be within the sample width.CubicInterpolationMode
getCubicInterpolationMode()
Returns algorithm used to interpolate a smooth curve from the discrete data points.IsFill
getFill()
Returns how to fill the area under the line.double
getHitRadius()
Returns the pixel size of the non-displayed point that reacts to mouse events.int
getHoverBorderWidth()
Returns the border width of point when hovered.double
getHoverRadius()
Returns the radius of the point when hovered.int
getOffset()
Returns the arc offset (in pixels).PointStyle
getPointStyle()
Returns the style of the point.Canvas
getPointStyleAsCanvas()
Returns the style of the point as canvas.
If property is missing or not an canvas, returnsnull
.Img
getPointStyleAsImage()
Returns the style of the point as image.
If property is missing or not an image, returnsnull
.PointStyleType
getPointStyleType()
Returns the type of point style.double
getRadius()
Returns the radius of the point.double
getRotation()
Returns the point rotation (in degrees).double
getTension()
Returns the Bézier curve tension (0 for no Bézier curves).double
getWeight()
Returns the relative thickness of the dataset.boolean
isBackgroundColorAsColor()
Returnstrue
if the background color is defined as color.boolean
isBackgroundColorAsGradient()
Returnstrue
if the background color is defined as gradient.boolean
isBackgroundColorAsPattern()
Returnstrue
if the background color is defined as canvas pattern.boolean
isBorderColorAsColor()
Returnstrue
if the border color is defined as color.boolean
isBorderColorAsGradient()
Returnstrue
if the border color is defined as gradient.boolean
isBorderRadiusAsObject()
Returnstrue
if the border width is defined asBarBorderRadius
.boolean
isBorderWidthAsObject()
Returnstrue
if the border width is defined asBarBorderWidth
.boolean
isCapBezierPoints()
Returnstrue
to keep Bézier control inside the chart,false
for no restriction.Stepped
isStepped()
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()
Returnstrue
if the background color is defined as color.- Returns:
true
if the background color is defined as color
-
isBackgroundColorAsGradient
public boolean isBackgroundColorAsGradient()
Returnstrue
if the background color is defined as gradient.- Returns:
true
if the background color is defined as gradient
-
isBackgroundColorAsPattern
public boolean isBackgroundColorAsPattern()
Returnstrue
if the background color is defined as canvas pattern.- Returns:
true
if 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
null
if is not a gradient
-
getBackgroundColorAsCanvasGradient
public CanvasGradientItem getBackgroundColorAsCanvasGradient()
Returns the background color as canvas gradient.- Returns:
- the background color or
null
if is not a canvas gradient
-
getBackgroundColorAsPattern
public Pattern getBackgroundColorAsPattern()
Returns the background color as pattern.- Returns:
- the background color or
null
if is not a pattern
-
getBackgroundColorAsCanvasPattern
public CanvasPatternItem getBackgroundColorAsCanvasPattern()
Returns the background color as canvas pattern.- Returns:
- the background color or
null
if is not a canvas pattern
-
isBorderWidthAsObject
public boolean isBorderWidthAsObject()
Returnstrue
if the border width is defined asBarBorderWidth
.- Returns:
true
if 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()
Returnstrue
if the border color is defined as color.- Returns:
true
if the border color is defined as color
-
isBorderColorAsGradient
public boolean isBorderColorAsGradient()
Returnstrue
if the border color is defined as gradient.- Returns:
true
if 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
null
if is not a gradient
-
getBorderColorAsCanvasGradient
public CanvasGradientItem getBorderColorAsCanvasGradient()
Returns the border color as canvas gradient.- Returns:
- the border color or
null
if 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()
Returnstrue
if the border width is defined asBarBorderRadius
.- Returns:
true
if 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()
Returnstrue
to keep Bézier control inside the chart,false
for no restriction.- Returns:
true
to keep Bézier control inside the chart,false
for 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 newTooltipLabelPointStyle
filling it with point style and rotation of dataset element.- Returns:
- new
TooltipLabelPointStyle
filling it with point style and rotation of dataset element
-
createTooltipLabelColor
public TooltipLabelColor createTooltipLabelColor()
Create newTooltipLabelColor
filling it with background and border color of dataset element.- Returns:
- new
TooltipLabelColor
filling it with background and border color of dataset element
-
-