AnyChart
API Reference
Still have questions?
Contact support
Top
You are looking at an outdated 7.7.0 version of this document. Switch to the 8.2.1 version to see the up to date information.

class anychart.core.ui.DataGrid Improve this Doc

Extends: anychart.core.VisualBaseWithBounds

Data grid element.
Data grid is a part of gantt chart or it can be used independently.

Methods Overview

Specific settings
column()Column settings.
endIndex()End index.
startIndex()Start index.
titleHeight()Title height.
Coloring
columnStroke()Column stroke settings.
rowEvenFill()Row even fill settings.
rowFill()Row fill settings.
rowHoverFill()Row fill settings on hover state.
rowOddFill()Row odd fill settings.
Data
data()Data settings.
Interactivity
tooltip()Tooltip settings.
Size and Position
horizontalOffset()Horizontal offset.
verticalOffset()Vertical offset
Miscellaneous
draw()Draws data grid.

Methods Description

column

Getter for column by index. Gets column by index or creates a new one if column doesn't exist yet.

Params:

Name Type Description
index number Column index or column.

Returns:

anychart.core.ui.DataGrid.Column - Column by index.

Try it:

Setter for first column.

Params:

Name Type Description
value anychart.core.ui.DataGrid.Column Column to set.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

Setter for column by index.

Params:

Name Type Description
index number Column index or column.
value anychart.core.ui.DataGrid.Column Column to set.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

columnStroke

Getter for the current column stroke.

Returns:

string anychart.graphics.vector.Stroke - The current column stroke.

Try it:

Setter for the column stroke.

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | string
"#ccd7e1"}
Value to set.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

data

Getter for data.

Returns:

anychart.data.Tree - Returns current data tree.

Try it:

Setter for new data.

Params:

Name Type Description
value anychart.data.Tree New data tree.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

draw

Draws data grid.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

endIndex

Getter for end index.

Returns:

number - Current end index.

Try it:

Setter end index.

Params:

Name Type Default Description
value number
0
Value to set.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

horizontalOffset

Getter for horizontal offset.

Returns:

number - Current value.

Try it:

Setter for horizontal offset.

Params:

Name Type Default Description
value number
0
Value to set.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

rowEvenFill

Getter for row even fill.

Returns:

anychart.graphics.vector.Fill string - Current row even fill.

Try it:

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

Params:

Name Type Default Description
value anychart.graphics.vector.Fill
"#fafafa"
Color as an object or a string.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.
Fill color with opacity.

Params:

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

Returns:

anychart.core.ui.DataGrid - 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.ui.DataGrid - 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.ui.DataGrid - Self instance for method chaining.

Try it:

Params:

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

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

rowFill

Getter for rows fill.

Returns:

anychart.graphics.vector.Fill string - Current rows fill.

Try it:

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

Params:

Name Type Default Description
value anychart.graphics.vector.Fill
"#fff"
Color as an object or a string.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.
Fill color with opacity.

Params:

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

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

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.ui.DataGrid - Self instance for method chaining.

Try it:

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.ui.DataGrid - Self instance for method chaining.

Try it:

Params:

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

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

rowHoverFill

Getter for row hover fill.

Returns:

anychart.graphics.vector.Fill string - Current row hover fill.

Try it:

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

Params:

Name Type Default Description
value anychart.graphics.vector.Fill
"#edf8ff"
Color as an object or a string.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.
Fill color with opacity.

Params:

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

Returns:

anychart.core.ui.DataGrid - 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.ui.DataGrid - 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.ui.DataGrid - Self instance for method chaining.

Try it:

Params:

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

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

rowOddFill

Getter for row odd fill.

Returns:

anychart.graphics.vector.Fill string - Current row odd fill.

Try it:

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

Params:

Name Type Default Description
value anychart.graphics.vector.Fill
"#fff"
Color as an object or a string.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.
Fill color with opacity.

Params:

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

Returns:

anychart.core.ui.DataGrid - 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.ui.DataGrid - 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.ui.DataGrid - Self instance for method chaining.

Try it:

Params:

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

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

startIndex

Getter for start index.

Returns:

number - Current start index.

Try it:

Setter for start index.

Params:

Name Type Default Description
value number
0
Value to set.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

titleHeight

Getter for title height.

Returns:

number - Current value for title height.

Try it:

Setter for title height.

Params:

Name Type Default Description
value number
25
Value to set.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it:

tooltip

Getter for tooltip settings.

Returns:

anychart.core.ui.Tooltip - Current settings tooltip.

Try it:

Getter for tooltip settings.

Params:

Name Type Default Description
value Object | boolean | null
true
Tooltip settings.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

verticalOffset

Getter for vertical offset.

Returns:

number - Current vertical offset.

Try it:

Setter for vertical offset.

Params:

Name Type Default Description
value number
0
Value to set.

Returns:

anychart.core.ui.DataGrid - Self instance for method chaining.

Try it: