Top
You are looking at an outdated 7.5.0 version of this document. Switch to the 8.0.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

Miscellaneous
backgroundFill()Getter for background fill.
cellBorder()Getter for cell border.
column()Getter for column by index. Gets column by index or creates a new one if column doesn't exist yet.
data()Getter for data.
draw()Draws data grid.
endIndex()Getter for end index.
horizontalOffset()Getter for horizontal offset.
rowEvenFill()Getter for row even fill.
rowFill()Getter for rows fill.
rowHoverFill()Getter for row hover fill.
rowOddFill()Getter for row odd fill.
startIndex()Getter for start index.
titleHeight()Getter for title height.
tooltip()Getter for tooltip settings.
verticalOffset()Getter for vertical offset.

Methods Description

backgroundFill

Getter for background fill.

Returns:

anychart.graphics.vector.Fill string - Current background 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:

cellBorder

Getter for cell border.

Returns:

string anychart.graphics.vector.Stroke - Current settings cell border.
Setter for cell border.

Params:

Name Type Default Description
value Object | string
{color: "#ccd7e1", thickness: 1}
Accepts only color and thickness settings.

Returns:

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

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:

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
#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:

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
#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:

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 Description
value number 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: