public class Grid extends Object
Modifier and Type | Method and Description |
---|---|
Axis |
getAxis()
Returns the axis instance.
|
IsColor |
getBorderColor()
If set, used as the color of the border line.
If unset, the first color option is resolved and used. |
String |
getBorderColorAsString()
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.
|
double |
getBorderDashOffset()
Returns the line dash pattern offset.
|
BorderDashOffsetCallback<ScaleContext> |
getBorderDashOffsetCallback()
Returns the border dash offset callback instance.
|
int |
getBorderWidth()
If set, used as the width of the border line.
If unset, the first lineWidth option is resolved and used. |
List<IsColor> |
getColor()
The color of the grid.
If specified as an array, the first color applies to the first grid line, the second to the second grid line and so on. |
List<String> |
getColorAsString()
The color of the grid.
If specified as an array, the first color applies to the first grid line, the second to the second grid line and so on. |
ColorCallback<ScaleContext> |
getColorCallback()
Returns the color callback instance.
|
List<Integer> |
getLineWidth()
Returns the stroke widths of grid.
|
WidthCallback<ScaleContext> |
getLineWidthCallback()
Returns the line width callback instance.
|
List<Integer> |
getTickBorderDash()
Returns the length and spacing of the tick mark line.
|
double |
getTickBorderDashOffset()
Returns the offset for the line dash of the tick mark.
|
BorderDashOffsetCallback<ScaleContext> |
getTickBorderDashOffsetCallback()
Returns the tick border dash offset callback instance.
|
List<IsColor> |
getTickColor()
The color of the grid.
If specified as an array, the first color applies to the first grid line, the second to the second grid line and so on. |
String |
getTickColorAsString()
Returns the color of the tick line.
|
ColorCallback<ScaleContext> |
getTickColorCallback()
Returns the tick color callback instance.
|
List<String> |
getTickColorsAsString()
The color of the grid.
If specified as an array, the first color applies to the first grid line, the second to the second grid line and so on. |
int |
getTickLength()
Returns the length in pixels that the grid will draw in the the axis area.
|
List<Integer> |
getTicksWidth()
Returns the width of the tick marks in pixels.
|
int |
getTickWidth()
Returns the width of the tick mark in pixels.
The first element if set as array. |
WidthCallback<ScaleContext> |
getTickWidthCallback()
Returns the tick width callback instance.
|
int |
getZ()
Returns z-index of grid line layer.
Values less than or equals to 0 are drawn under datasets, greater than 0 on top. |
boolean |
isCircular()
If true, grid are circular (on radar chart only).
|
boolean |
isDisplay()
If false, do not display grid for this axis.
|
boolean |
isDrawBorder()
If true, draw border at the edge between the axis and the chart area.
|
boolean |
isDrawOnChartArea()
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. |
boolean |
isDrawTicks()
If true, draw lines beside the ticks in the axis area beside the chart.
|
boolean |
isOffset()
If true, grid will be shifted to be between labels.
This is set to true in the bar chart by default. |
void |
setBorderColor(IsColor color)
If set, used as the color of the border line.
If unset, the first color option is resolved and used. |
void |
setBorderColor(String color)
If set, used as the color of the border line.
If unset, the first color option is resolved and used. |
void |
setBorderDash(int... borderDash)
Sets 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.
|
void |
setBorderDashOffset(BorderDashOffsetCallback<ScaleContext> borderDashOffsetCallback)
Sets the border dash offset callback instance.
|
void |
setBorderDashOffset(double borderDashOffset)
Sets the line dash pattern offset.
|
void |
setBorderDashOffset(NativeCallback borderDashOffsetCallback)
Sets the border dash offset callback instance.
|
void |
setBorderWidth(int borderWidth)
If set, used as the width of the border line.
If unset, the first lineWidth option is resolved and used. |
void |
setCircular(boolean circular)
If true, grid are circular (on radar chart only).
|
void |
setColor(ColorCallback<ScaleContext> colorCallback)
Sets the color callback instance.
|
void |
setColor(IsColor... color)
The color of the grid.
If specified as an array, the first color applies to the first grid line, the second to the second grid line and so on. |
void |
setColor(NativeCallback colorCallback)
Sets the color callback instance.
|
void |
setColor(String... color)
The color of the grid.
If specified as an array, the first color applies to the first grid line, the second to the second grid line and so on. |
void |
setDisplay(boolean display)
If false, do not display grid for this axis.
|
void |
setDrawBorder(boolean drawBorder)
If true, draw border at the edge between the axis and the chart area.
|
void |
setDrawOnChartArea(boolean drawOnChartArea)
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. |
void |
setDrawTicks(boolean drawTicks)
If true, draw lines beside the ticks in the axis area beside the chart.
|
void |
setLineWidth(int... lineWidth)
Sets the stroke widths of grid.
|
void |
setLineWidth(NativeCallback lineWidthCallback)
Sets the line width callback instance.
|
void |
setLineWidth(WidthCallback<ScaleContext> lineWidthCallback)
Sets the line width callback instance.
|
void |
setOffset(boolean offset)
If true, grid will be shifted to be between labels.
This is set to true in the bar chart by default. |
void |
setTickBorderDash(int tickBorderDash)
Sets the length and spacing of the tick mark line.
|
void |
setTickBorderDashOffset(BorderDashOffsetCallback<ScaleContext> tickBorderDashOffsetCallback)
Sets the tick border dash offset callback instance.
|
void |
setTickBorderDashOffset(double tickBorderDashOffset)
Sets the offset for the line dash of the tick mark.
|
void |
setTickBorderDashOffset(NativeCallback tickBorderDashOffsetCallback)
Sets the tick border dash offset callback instance.
|
void |
setTickColor(ColorCallback<ScaleContext> tickColorCallback)
Sets the tick color callback instance.
|
void |
setTickColor(IsColor... color)
Sets the color of the tick line.
|
void |
setTickColor(NativeCallback tickColorCallback)
Sets the tick color callback instance.
|
void |
setTickColor(String... color)
Sets the color of the tick line.
|
void |
setTickLength(int tickLength)
Sets the length in pixels that the grid will draw in the the axis area.
|
void |
setTickWidth(int... tickWidth)
Sets the width of the tick marks in pixels.
|
void |
setTickWidth(NativeCallback tickWidthCallback)
Sets the tick width callback instance.
|
void |
setTickWidth(WidthCallback<ScaleContext> tickWidthCallback)
Sets the tick width callback instance.
|
void |
setZ(int z)
Sets z-index of grid line layer.
Values less than or equals to 0 are drawn under datasets, greater than 0 on top. |
public void setDisplay(boolean display)
display
- If false, do not display grid for this axis.public boolean isDisplay()
public void setCircular(boolean circular)
circular
- If true, grid are circular (on radar chart only).public boolean isCircular()
public void setColor(IsColor... color)
color
- The color of the grid.public void setColor(String... color)
color
- The color of the grid.public List<String> getColorAsString()
public List<IsColor> getColor()
public void setBorderColor(IsColor color)
color
- if set, used as the color of the border line.public void setBorderColor(String color)
color
- if set, used as the color of the border line.public String getBorderColorAsString()
public IsColor getBorderColor()
public void setBorderWidth(int borderWidth)
borderWidth
- if set, used as the width of the border line.public int getBorderWidth()
public void setBorderDash(int... borderDash)
borderDash
- the line dash pattern used when stroking linespublic List<Integer> getBorderDash()
public void setBorderDashOffset(double borderDashOffset)
borderDashOffset
- Offset for line dashes.public double getBorderDashOffset()
public void setLineWidth(int... lineWidth)
lineWidth
- stroke widths of grid.public List<Integer> getLineWidth()
public void setDrawBorder(boolean drawBorder)
drawBorder
- If true, draw border at the edge between the axis and the chart area.public boolean isDrawBorder()
public void setDrawOnChartArea(boolean drawOnChartArea)
drawOnChartArea
- If true, draw lines on the chart area inside the axis lines.public boolean isDrawOnChartArea()
public void setDrawTicks(boolean drawTicks)
drawTicks
- If true, draw lines beside the ticks in the axis area beside the chart.public boolean isDrawTicks()
public void setTickLength(int tickLength)
tickLength
- Length in pixels that the grid will draw in the the axis area.public int getTickLength()
public void setOffset(boolean offset)
offset
- If true, grid will be shifted to be between labels.public boolean isOffset()
public void setZ(int z)
z
- z-index of grid line layer.public int getZ()
public void setTickBorderDash(int tickBorderDash)
tickBorderDash
- the length and spacing of the tick mark line.public List<Integer> getTickBorderDash()
public void setTickBorderDashOffset(double tickBorderDashOffset)
tickBorderDashOffset
- the offset for the line dash of the tick markpublic double getTickBorderDashOffset()
public void setTickColor(IsColor... color)
color
- the color of the tick line.public void setTickColor(String... color)
color
- the color of the tick line.public String getTickColorAsString()
public List<String> getTickColorsAsString()
public List<IsColor> getTickColor()
public void setTickWidth(int... tickWidth)
tickWidth
- the width of the tick mark in pixelspublic int getTickWidth()
public List<Integer> getTicksWidth()
public ColorCallback<ScaleContext> getTickColorCallback()
public void setTickColor(ColorCallback<ScaleContext> tickColorCallback)
tickColorCallback
- the tick color callback instancepublic void setTickColor(NativeCallback tickColorCallback)
tickColorCallback
- the tick color callback instancepublic WidthCallback<ScaleContext> getTickWidthCallback()
public void setTickWidth(WidthCallback<ScaleContext> tickWidthCallback)
tickWidthCallback
- the tick width callback instance.public void setTickWidth(NativeCallback tickWidthCallback)
tickWidthCallback
- the tick width callback instance.public BorderDashOffsetCallback<ScaleContext> getTickBorderDashOffsetCallback()
public void setTickBorderDashOffset(BorderDashOffsetCallback<ScaleContext> tickBorderDashOffsetCallback)
tickBorderDashOffsetCallback
- the tick border dash offset callback instancepublic void setTickBorderDashOffset(NativeCallback tickBorderDashOffsetCallback)
tickBorderDashOffsetCallback
- the tick border dash offset callback instancepublic ColorCallback<ScaleContext> getColorCallback()
public void setColor(ColorCallback<ScaleContext> colorCallback)
colorCallback
- the color callback instancepublic void setColor(NativeCallback colorCallback)
colorCallback
- the color callback instancepublic WidthCallback<ScaleContext> getLineWidthCallback()
public void setLineWidth(WidthCallback<ScaleContext> lineWidthCallback)
lineWidthCallback
- the line width callback instance.public void setLineWidth(NativeCallback lineWidthCallback)
lineWidthCallback
- the line width callback instance.public BorderDashOffsetCallback<ScaleContext> getBorderDashOffsetCallback()
public void setBorderDashOffset(BorderDashOffsetCallback<ScaleContext> borderDashOffsetCallback)
borderDashOffsetCallback
- the border dash offset callback instancepublic void setBorderDashOffset(NativeCallback borderDashOffsetCallback)
borderDashOffsetCallback
- the border dash offset callback instancepublic final Axis getAxis()