Class DefaultGrid
- java.lang.Object
-
- org.pepstock.charba.client.defaults.globals.DefaultGrid
-
- All Implemented Interfaces:
IsDefaultGrid,IsDefaultScaleLines
public final class DefaultGrid extends Object implements IsDefaultGrid
CHART.JS default values for GRID element.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBorderColorAsString()If set, used as the color of the border line.
If unset, the first color option is resolved and used.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.doublegetBorderDashOffset()Returns the line dash pattern offset.intgetBorderWidth()If set, used as the width of the border line.
If unset, the first lineWidth option is resolved and used.StringgetColorAsString()Returns the color of lines.intgetLineWidth()Returns the width of lines.doublegetTickBorderDashOffset()Returns the offset for the line dash of the tick mark.StringgetTickColorAsString()Returns the color of the tick line.intgetTickLength()Returns the length in pixels that the grid will draw in the axis area.intgetTickWidth()Returns the width of the tick mark in pixels.
The first element if set as array.intgetZ()Returns z-index of grid layer.
Values less than or equals to 0 are drawn under data sets, greater than 0 on top.booleanisCircular()Iftrue, grid are circular (on radar chart only).booleanisDisplay()Iffalse, do not display grid for this axis.booleanisDrawBorder()Iftrue, draw border at the edge between the axis and the chart area.booleanisDrawOnChartArea()Iftrue, draw lines on the chart area inside the axis lines.
This is useful when there are multiple axes and you need to control which grid are drawn.booleanisDrawTicks()Iftrue, draw lines beside the ticks in the axis area beside the chart.booleanisOffset()Iftrue, grid will be shifted to be between labels.
-
-
-
Method Detail
-
isDisplay
public boolean isDisplay()
Description copied from interface:IsDefaultGridIffalse, do not display grid for this axis.- Specified by:
isDisplayin interfaceIsDefaultGrid- Returns:
- if
false, do not display grid for this axis.
-
getColorAsString
public String getColorAsString()
Description copied from interface:IsDefaultScaleLinesReturns the color of lines.- Specified by:
getColorAsStringin interfaceIsDefaultScaleLines- Returns:
- color of lines.
-
getBorderDashOffset
public double getBorderDashOffset()
Description copied from interface:IsDefaultScaleLinesReturns the line dash pattern offset.- Specified by:
getBorderDashOffsetin interfaceIsDefaultScaleLines- Returns:
- Offset for line dashes.
-
getBorderWidth
public int getBorderWidth()
Description copied from interface:IsDefaultGridIf set, used as the width of the border line.
If unset, the first lineWidth option is resolved and used.- Specified by:
getBorderWidthin interfaceIsDefaultGrid- Returns:
- if set, used as the width of the border line.
If unset, the first lineWidth option is resolved and used.
-
getBorderColorAsString
public String getBorderColorAsString()
Description copied from interface:IsDefaultGridIf set, used as the color of the border line.
If unset, the first color option is resolved and used.- Specified by:
getBorderColorAsStringin interfaceIsDefaultGrid- Returns:
- if set, used as the color of the border line.
If unset, the first color option is resolved and used.
-
getLineWidth
public int getLineWidth()
Description copied from interface:IsDefaultScaleLinesReturns the width of lines.- Specified by:
getLineWidthin interfaceIsDefaultScaleLines- Returns:
- width of lines.
-
isDrawBorder
public boolean isDrawBorder()
Description copied from interface:IsDefaultGridIftrue, draw border at the edge between the axis and the chart area.- Specified by:
isDrawBorderin interfaceIsDefaultGrid- Returns:
- if
true, draw border at the edge between the axis and the chart area.
-
isDrawOnChartArea
public boolean isDrawOnChartArea()
Description copied from interface:IsDefaultGridIftrue, draw lines on the chart area inside the axis lines.
This is useful when there are multiple axes and you need to control which grid are drawn.- Specified by:
isDrawOnChartAreain interfaceIsDefaultGrid- Returns:
- if
true, draw lines on the chart area inside the axis lines.
This is useful when there are multiple axes and you need to control which grid are drawn.
-
isDrawTicks
public boolean isDrawTicks()
Description copied from interface:IsDefaultGridIftrue, draw lines beside the ticks in the axis area beside the chart.- Specified by:
isDrawTicksin interfaceIsDefaultGrid- Returns:
- if
true, draw lines beside the ticks in the axis area beside the chart.
-
getTickLength
public int getTickLength()
Description copied from interface:IsDefaultGridReturns the length in pixels that the grid will draw in the axis area.- Specified by:
getTickLengthin interfaceIsDefaultGrid- Returns:
- Length in pixels that the grid will draw in the axis area.
-
isOffset
public boolean isOffset()
Description copied from interface:IsDefaultGridIftrue, grid will be shifted to be between labels. This is set totruein the bar chart by default.- Specified by:
isOffsetin interfaceIsDefaultGrid- Returns:
- If
true, grid will be shifted to be between labels.
-
isCircular
public boolean isCircular()
Description copied from interface:IsDefaultGridIftrue, grid are circular (on radar chart only).- Specified by:
isCircularin interfaceIsDefaultGrid- Returns:
- If
true, grid are circular (on radar chart only).
-
getZ
public int getZ()
Description copied from interface:IsDefaultGridReturns z-index of grid layer.
Values less than or equals to 0 are drawn under data sets, greater than 0 on top.- Specified by:
getZin interfaceIsDefaultGrid- Returns:
- z-index of grid layer.
Values less than or equals to 0 are drawn under data sets, greater than 0 on top.
-
getTickBorderDashOffset
public double getTickBorderDashOffset()
Description copied from interface:IsDefaultGridReturns the offset for the line dash of the tick mark.- Specified by:
getTickBorderDashOffsetin interfaceIsDefaultGrid- Returns:
- the offset for the line dash of the tick mark
-
getTickColorAsString
public String getTickColorAsString()
Description copied from interface:IsDefaultGridReturns the color of the tick line.- Specified by:
getTickColorAsStringin interfaceIsDefaultGrid- Returns:
- the color of the tick line.
-
getTickWidth
public int getTickWidth()
Description copied from interface:IsDefaultGridReturns the width of the tick mark in pixels.
The first element if set as array.- Specified by:
getTickWidthin interfaceIsDefaultGrid- Returns:
- stroke width of grid.
The first element if set as array.
-
getBorderDash
public List<Integer> getBorderDash()
Description copied from interface:IsDefaultScaleLinesReturns 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.- Specified by:
getBorderDashin interfaceIsDefaultScaleLines- Returns:
- the line dash pattern used when stroking lines
-
-