Top
You are looking at an outdated 7.7.0 version of this document. Switch to the 8.0.1 version to see the up to date information.

class anychart.core.grids.Stock Improve this Doc

Extends: anychart.core.VisualBase

Grid.

Methods Overview

Specific settings
drawFirstLine()Drawing first line.
drawLastLine()Drawing last line.
isMinor()Minor grid or not.
Coloring
evenFill()Even fill settings.
oddFill()Odd fill settings.
stroke()Stroke fill settings.
Scales
scale()Scale settings.
Size and Position
isHorizontal()Whether an grid has horizontal layout.
layout()Layout setting.

Methods Description

drawFirstLine

Getter for the first line drawing flag.

Returns:

boolean - Drawing flag.

Try it:

Setter for the first line drawing flag. Whether to draw the first line.

Params:

Name Type Default Description
value boolean
true
Whether grid should draw first line.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

drawLastLine

Getter for the last line drawing flag.

Returns:

boolean - Drawing flag.

Try it:

Setter for the last line drawing flag. Whether to draw the last line.

Params:

Name Type Default Description
value boolean
true
Whether grid should draw last line.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

evenFill

Getter for the current grid even fill settings.

Returns:

string anychart.graphics.vector.Fill - The current grid even fill settings.

Try it:

Sets even fill settings using an array or a string. Learn more about coloring.

Params:

Name Type Description
value anychart.graphics.vector.Fill Color as an array or a string.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.
Fill color with opacity. Fill as a string or an object.

Params:

Name Type Default Description
color string
"#f5f5f5"
Color as a string.
opacity number
0.3
Color opacity.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

Linear gradient fill. Learn more about coloring.

Params:

Name Type Description
keys Array.<(anychart.graphics.vector.GradientKey|string)> Gradient keys.
angle number Gradient angle.
mode boolean | anychart.graphics.vector.Rect | Object Gradient mode.
opacity number Gradient opacity.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

Radial gradient fill. Learn more about coloring.

Params:

Name Type Description
keys Array.<(anychart.graphics.vector.GradientKey|string)> Color-stop gradient keys.
cx number X ratio of center radial gradient.
cy number Y ratio of center radial gradient.
mode anychart.graphics.math.Rect If defined then userSpaceOnUse mode, else objectBoundingBox.
opacity number Opacity of the gradient.
fx number X ratio of focal point.
fy number Y ratio of focal point.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

Params:

Name Type Description
imageSettings anychart.graphics.vector.Fill Object with settings.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

isHorizontal

Whether an grid has horizontal layout.
Layout is define by method anychart.core.grids.Stock#layout.

Returns:

boolean - Returns true if the grid's layout is horizontal.

Try it:

isMinor

Getter for the minor grid state flag.

Returns:

boolean - Boolean flag.

Try it:

Setter for the minor grid state flag. Whether it is a minor grid or not.

Params:

Name Type Default Description
value boolean
false
Minor or not.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

layout

Getter for the current grid layout.

Returns:

anychart.enums.Layout - The current grid layout.

Try it:

Setter for the grid layout.

Params:

Name Type Default Description
value anychart.enums.Layout
"horizontal"
Grid layout.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

oddFill

Getter for the current grid odd fill settings.

Returns:

anychart.graphics.vector.Fill - The current grid odd fill settings.

Try it:

Sets odd fill settings using an array or a string. Learn more about coloring.

Params:

Name Type Default Description
value anychart.graphics.vector.Fill
"none"
Color as an array or a string.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.
Fill color with opacity. Fill as a string or an object.

Params:

Name Type Description
color string Color as a string.
opacity number Color opacity.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

Linear gradient fill. Learn more about coloring.

Params:

Name Type Description
keys Array.<(anychart.graphics.vector.GradientKey|string)> Gradient keys.
angle number Gradient angle.
mode boolean | anychart.graphics.vector.Rect | Object Gradient mode.
opacity number Gradient opacity.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

Radial gradient fill. Learn more about coloring.

Params:

Name Type Description
keys Array.<(anychart.graphics.vector.GradientKey|string)> Color-stop gradient keys.
cx number X ratio of center radial gradient.
cy number Y ratio of center radial gradient.
mode anychart.graphics.math.Rect If defined then userSpaceOnUse mode, else objectBoundingBox.
opacity number Opacity of the gradient.
fx number X ratio of focal point.
fy number Y ratio of focal point.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

Params:

Name Type Description
imageSettings anychart.graphics.vector.Fill Object with settings.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

scale

Getter for the current axis scale.
See listing
var currentPlot = chart.plot();
var plotGrid = currentPlot.grid();
plotGrid.scale()
Setter for the axis scale.

Params:

Name Type Description
value anychart.scales.Base | anychart.scales.StockScatterDateTime Value to set.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it:

stroke

Getter for the current grid stroke line.

Returns:

anychart.graphics.vector.Stroke - The current grid stroke line settings.

Try it:

Setter for the grid stroke settings. Learn more about stroke settings.

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null
"#cecece"
Stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.grids.Stock - Self instance for method chaining.

Try it: