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

class anychart.core.ui.Table Improve this Doc

Extends: anychart.core.VisualBaseWithBounds

Declares table element.
Note: Better to use methods in anychart.ui#table.

Methods Overview

Specific settings
colsCount()Columns count.
colsMaxWidth()Column maximum width.
colsMinWidth()Column minimum width.
colsWidth()Column width.
contents()Table content.
getCell()Returns cell by its row and column number.
getCol()Returns column instance by its number.
getRow()Returns row instance by its number.
rowsCount()Rows count.
rowsHeight()Row height settings.
rowsMaxHeight()Rows maximum height.
rowsMinHeight()Rows minimum height.
Advanced Text Settings
fontVariant()Font variant settings.
letterSpacing()Letter spacing settings.
lineHeight()Line height settings.
textIndent()Text indent settings.
textOverflow()Text overflow settings.
textWrap()Text wrap settings.
useHtml()Text useHtml settings.
Base Text Settings
fontColor()Font color settings.
fontDecoration()Font decoration settings.
fontFamily()Font family settings.
fontOpacity()Font opacity settings.
fontSize()Font size settings.
fontStyle()Font style settings.
fontWeight()Font weight settings.
hAlign()Horizontal align settings.
textDirection()Letter direction settings.
vAlign()Vertical align settings.
Coloring
border()Border settings.
cellBorder()Cell border settings.
cellFill()Cell fill settings.
rowEvenFill()Row even fill settings.
rowOddFill()Row odd fill settings.
Events
disablePointerEvents()Disable pointer events settings.
listen()Adds an event listener.
listenOnce()Adds a single time event listener.
removeAllListeners()Removes all listeners.
unlisten()Removes the listener.
unlistenByKey()Removes the listener by the key.
Export
print()Prints all elements.
saveAsJpg()Saves into JPEG file.
saveAsPdf()Saves into PDF file.
saveAsPng()Saves into PNG file.
saveAsSvg()Saves into SVG file.
toSvg()Returns SVG string.
Interactivity
enabled()Element state (enabled or disabled).
selectable()Text selectable option.
Size and Position
bottom()Bottom bound setting.
bounds()Bounds settings.
cellPadding()Cell padding settings.
getPixelBounds()Returns pixel bounds.
height()Height setting.
left()Left bound setting.
maxHeight()Maximum height.
maxWidth()Maximum width.
minHeight()Minimum height.
minWidth()Minimum width.
right()Right bound setting.
top()Top bound setting.
width()Width setting.
zIndex()Z-index of the element.
Miscellaneous
draw()Draws the table.
getJpgBase64String()Returns JPG as base64 string.
getPdfBase64String()Returns PDF as base64 string.
getPngBase64String()Returns PNG as base64 string.
getSvgBase64String()Returns SVG as base64 string.
shareAsJpg()Shares a table as a JPG file and returns a link to the shared image.
shareAsPdf()Shares a table as a PDF file and returns a link to the shared image.
shareAsPng()Shares a table as a PNG file and returns a link to the shared image.
shareAsSvg()Shares a table as a SVG file and returns a link to the shared image.

Methods Description

border

Getter for border of the table (not cells).

Returns:

anychart.core.ui.table.Border - Current border settings.
Setter for border of the table (not cells).

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null
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.ui.Table - Self instance for method chaining.

Try it:

bottom

Getter for element bottom bound setting.

Returns:

number string undefined - Current element's bottom bound setting.
Sets element bottom bound setting.

Params:

Name Type Default Description
value number | string | null
null
Bottom bound setting for the element.

Returns:

anychart.core.VisualBaseWithBounds - Returns self for method chaining.

Try it:

bounds

Getter for the element bounds settings.

Returns:

anychart.core.utils.Bounds - Current bounds of the element.
Sets bounds of the element using one parameter.

Params:

Name Type Description
value anychart.utils.RectObj | anychart.math.Rect | anychart.core.utils.Bounds Bounds of element.

Returns:

anychart.core.VisualBase - Self instance for method chaining.

Try it:

Setter for the element bounds settings.

Params:

Name Type Default Description
x number | string
null
X-coordinate.
y number | string
null
Y-coordinate.
width number | string
null
Width.
height number | string
null
Height.

Returns:

anychart.core.VisualBase - Self instance for method chaining.

Try it:

cellBorder

Getter for current cell border settings.

Returns:

anychart.graphics.vector.Stroke - Current stroke settings.
Setter for cell border settings. Learn more about stroke settings.

Params:

Name Type Default Description
strokeOrFill anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Fill settings or 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.ui.Table - Self instance for method chaining.

Try it:

cellFill

Getter for current table fill color.

Returns:

anychart.graphics.vector.Fill - Current fill color.
Sets fill settings using an object or a string. Learn more about coloring.

Params:

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

Returns:

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

Try it:

Params:

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

Returns:

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

Try it:

cellPadding

Setter for cell paddings in pixels using a single value.

Params:

Name Type Description
value null | Array.<(number|string)> | Object Value to set.

Returns:

anychart.core.ui.Table - Self instance for method chaining.
Examples for paddings
// all paddings 15px
table.cellPadding(15);
// all paddings 15px
table.cellPadding('15px');
// top and bottom 5px, right and left 15px
table.cellPadding(anychart.utils.padding(5,15));

Try it:

Setter for cell paddings in pixels using several numbers.

Params:

Name Type Description
value1 string | number Top or top-bottom space.
value2 string | number Right or right-left space.
value3 string | number Bottom space.
value4 string | number Left space.

Returns:

anychart.core.ui.Table - Self instance for method chaining.
Examples for paddings
// 1) top and bottom 10px, left and right 15px
table.cellPadding(10, '15px');
// 2) top 10px, left and right 15px, bottom 5px
table.cellPadding(10, '15px', 5);
// 3) top 10px, right 15px, bottom 5px, left 12px
table.cellPadding(10, '15px', '5px', 12);

Try it:

colsCount

Getter for table columns count.

Returns:

number - Current columns count.

Try it:

Setter for table columns count.

Params:

Name Type Default Description
value number
4
Value to set.

Returns:

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

Try it:

colsMaxWidth

Getter for default column width maximum settings.

Returns:

string number null - Current column width maximum settings.
Setter for column width maximum settings.

Params:

Name Type Default Description
value string | number | null
null
Value to set.

Returns:

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

Try it:

colsMinWidth

Getter for default column width minimum settings.

Returns:

string number null - Current column width minimum settings.
Setter for column width minimum settings.

Params:

Name Type Default Description
value string | number | null
null
Value to set.

Returns:

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

Try it:

colsWidth

Getter for default column width settings.

Returns:

string number null - Current column width settings.
Setter for column width settings.

Params:

Name Type Default Description
value string | number | null
null
Value to set.

Returns:

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

Try it:

contents

Getter for table content. Note: Returns cells content ignored rowSpan and colSpan.

Returns:

Array.<Array.<(anychart.core.VisualBase)>> - Current table content.
Setter for table content.

Params:

Name Type Default Description
tableValues Array.<Array.<(anychart.core.VisualBase|string|number|undefined)>>
Values to set.
demergeCells boolean
false
Pass true to demerge all cells.

Returns:

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

Try it:

disablePointerEvents

Gets current state of disablePointerEvents option.

Returns:

boolean - If pointer events are disabled.
Setter for the text disablePointerEvents option.

Params:

Name Type Default Description
value boolean
false
Value to set.

Returns:

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

draw

Draws the table.

Returns:

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

Try it:

enabled

Getter for the current element state (enabled or disabled).

Returns:

boolean - The current element state.

Try it:

Setter for the element enabled state.

Params:

Name Type Default Description
value boolean
true
Value to set.

Returns:

anychart.core.VisualBase - Self instance for method chaining.
Example.
if (!element.enabled())
   element.enabled(true);

Try it:

fontColor

Getter for the text font color.

Returns:

string - The current font color.
Setter for the text font color. https://www.w3schools.com/html/html_colors.asp

Params:

Name Type Description
value string Value to set.

Returns:

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

Try it:

fontDecoration

Getter for the text font decoration.

Returns:

anychart.graphics.vector.Text.Decoration string - The current font decoration.
Setter for the text font decoration.

Params:

Name Type Default Description
value anychart.graphics.vector.Text.Decoration | string
anychart.graphics.vector.Text.Decoration#NONE
Value to set.

Returns:

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

Try it:

fontFamily

Getter for the font family.

Returns:

string - The current font family.
Setter for font family.

Params:

Name Type Description
value string Value to set.

Returns:

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

Try it:

fontOpacity

Getter for the text font opacity.

Returns:

number - The current font opacity.
Setter for the text font opacity. Double value from 0 to 1.

Params:

Name Type Description
value number Value to set.

Returns:

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

Try it:

fontSize

Getter for text font size.

Returns:

string number - Current font size.
Setter for text font size.

Params:

Name Type Description
value string | number Value to set.

Returns:

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

Try it:

fontStyle

Getter for the text font style.

Returns:

anychart.graphics.vector.Text.FontStyle string - The current font style.
Setter for the text font style.

Params:

Name Type Default Description
value anychart.graphics.vector.Text.FontStyle | string
anychart.graphics.vector.Text.FontStyle#NORMAL
Value to set.

Returns:

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

Try it:

fontVariant

Getter for the text font variant.

Returns:

anychart.graphics.vector.Text.FontVariant string - The current font variant.
Setter for the text font variant.

Params:

Name Type Default Description
value anychart.graphics.vector.Text.FontVariant | string
anychart.graphics.vector.Text.FontVariant#NORMAL
Value to set.

Returns:

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

Try it:

fontWeight

Getter for the text font weight.

Returns:

string number - The current font weight.
Setter for the text font weight. https://www.w3schools.com/cssref/pr_font_weight.asp

Params:

Name Type Description
value string | number Value to set.

Returns:

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

Try it:

getCell

Returns cell by its row and column number.

Params:

Name Type Description
row number Row index.
col number Column index.

Returns:

anychart.core.ui.table.Cell - Self instance for method chaining.

Try it:

getCol

Returns column instance by its number.

Params:

Name Type Description
col number A column by number

Returns:

anychart.core.ui.table.Column - Self instance for method chaining.

Try it:

getJpgBase64String

Returns JPG as base64 string.

Params:

Name Type Description
onSuccess function Function that is called when sharing is complete.
onError function Function that is called if sharing fails.
width number Image width.
height number Image height.
quality number Image quality in ratio 0-1.
forceTransparentWhite boolean Force transparent to white or not.

Try it:

getPdfBase64String

Returns PDF as base64 string.

Params:

Name Type Description
onSuccess function Function that is called when sharing is complete.
onError function Function that is called if sharing fails.
paperSizeOrWidth number | string Any paper format like 'a0', 'tabloid', 'b4', etc.
landscapeOrWidth number | boolean Define, is landscape.
x number Offset X.
y number Offset Y.

Try it:

getPixelBounds

Returns pixel bounds of the element due to parent bounds and self bounds settings.

Returns:

anychart.math.Rect - Pixel bounds of the element.

getPngBase64String

Returns PNG as base64 string.

Params:

Name Type Description
onSuccess function Function that is called when sharing is complete.
onError function Function that is called if sharing fails.
width number Image width.
height number Image height.
quality number Image quality in ratio 0-1.

Try it:

getRow

Returns row instance by its number.

Params:

Name Type Description
row number A row by number.

Returns:

anychart.core.ui.table.Row - Self instance for method chaining.

Try it:

getSvgBase64String

Returns SVG as base64 string.

Params:

Name Type Description
onSuccess function Function that is called when sharing is complete.
onError function Function that is called if sharing fails.
paperSizeOrWidth string | number Paper Size or width.
landscapeOrHeight boolean | string Landscape or height.

Try it:

hAlign

Getter for the text horizontal align.

Returns:

anychart.graphics.vector.Text.HAlign string - The current text horizontal align.
Setter for the text horizontal align.

Params:

Name Type Default Description
value anychart.graphics.vector.Text.HAlign | string
anychart.graphics.vector.Text.HAlign#START
Value to set.

Returns:

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

Try it:

height

Getter for element height setting.

Returns:

number string undefined - Current element's height setting.
Sets element height setting.

Params:

Name Type Default Description
value number | string | null
null
Height setting for the element.

Returns:

anychart.core.VisualBaseWithBounds - Returns self for method chaining.

Try it:

left

Getter for element left bound setting.

Returns:

number string undefined - Current element's left bound setting.
Sets element left bound setting.

Params:

Name Type Default Description
value number | string | null
null
Left bound setting for the element.

Returns:

anychart.core.VisualBaseWithBounds - Returns self for method chaining.

Try it:

letterSpacing

Getter for the text letter spacing.

Returns:

string number - The current letter spacing.

Params:

Name Type Description
value string | number Value to set.

Returns:

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

Try it:

lineHeight

Getter for the text line height.

Returns:

string number - The current text line height.

Params:

Name Type Description
value string | number Value to set.

Returns:

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

Try it:

listen

Adds an event listener to an implementing object.

Params:

Name Type Description
type string The event type id.
listener function Callback method. Function that looks like function(event){ // event.actualTarget - actual event target // event.currentTarget - current event target // event.iterator - event iterator // event.originalEvent - original event // event.point - event point // event.pointIndex - event point index }.
useCapture boolean Whether to fire in capture phase (defaults to false).
listenerScope Object Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

Try it:

listenOnce

Adds an event listener to an implementing object.

Params:

Name Type Description
type string The event type id.
listener function Callback method.
useCapture boolean Whether to fire in capture phase (defaults to false).
listenerScope Object Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

Try it:

maxHeight

Getter for maximum height.

Returns:

number string null - Current element's maximum height.
Setter for maximum height.

Params:

Name Type Default Description
value number | string | null
null
Value to set.

Returns:

anychart.core.VisualBase - Self instance for method chaining.

Try it:

maxWidth

Getter for maximum width.

Returns:

number string null - Current element's maximum width.
Setter for maximum width.

Params:

Name Type Default Description
value number | string | null
null
Value to set.

Returns:

anychart.core.VisualBase - Self instance for method chaining.

Try it:

minHeight

Getter for minimum height.

Returns:

number string null - Current element's minimum height.
Setter for minimum height.

Params:

Name Type Default Description
value number | string | null
null
Value to set.

Returns:

anychart.core.VisualBase - Self instance for method chaining.

Try it:

minWidth

Getter for minimum width.

Returns:

number string null - Current element's minimum width.
Setter for minimum width.

Params:

Name Type Default Description
value number | string | null
null
Value to set.

Returns:

anychart.core.VisualBase - Self instance for method chaining.

Try it:

print

Prints all elements on related stage.

Params:

Name Type Default Description
paperSize anychart.graphics.vector.PaperSize
Paper size.
landscape boolean
false
Flag of landscape.

Try it:

removeAllListeners

Removes all listeners from an object. You can also optionally remove listeners of some particular type.

Params:

Name Type Description
type string Type of event to remove, default is to remove all types.

Returns:

number - Number of listeners removed.

Try it:

Getter for element right bound setting.

Returns:

number string undefined - Current element's right bound setting.
Sets element right bound setting.

Params:

Name Type Default Description
value number | string | null
null
Right bound setting for the element.

Returns:

anychart.core.VisualBaseWithBounds - Returns self for method chaining.

Try it:

rowEvenFill

Getter for a current even row fill color.

Returns:

anychart.graphics.vector.Fill - Current fill color.
Sets fill settings using an object or a string. Learn more about coloring.

Params:

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

Returns:

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

Try it:

Params:

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

Returns:

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

Try it:

rowOddFill

Getter for a current odd row fill color.

Returns:

anychart.graphics.vector.Fill - Current fill color.
Sets fill settings using an object or a string. Learn more about coloring.

Params:

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

Returns:

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

Try it:

Params:

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

Returns:

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

Try it:

rowsCount

Getter for table rows count.

Returns:

number - Current rows count.

Try it:

Setter for table rows count.

Params:

Name Type Default Description
value number
5
Value to set.

Returns:

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

Try it:

rowsHeight

Getter for default row height settings.

Returns:

string number null - Current row height settings.
Setter for row height settings.

Params:

Name Type Default Description
value string | number | null
null
Value to set.

Returns:

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

Try it:

rowsMaxHeight

Getter for default row height maximum settings.

Returns:

string number null - Current row height maximum settings.
Setter for row height maximum settings.

Params:

Name Type Default Description
value string | number | null
null
Value to set.

Returns:

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

Try it:

rowsMinHeight

Getter for default row height minimum settings.

Returns:

string number null - Current row height minimum settings.
Setter for row height minimum settings.

Params:

Name Type Default Description
value string | number | null
null
Value to set.

Returns:

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

Try it:

saveAsJpg

Saves the current table into JPEG file.

Params:

Name Type Description
width number Image width.
height number Image height.
quality number Image quality in ratio 0-1.
forceTransparentWhite boolean Force transparent to white or not.

Try it:

saveAsPdf

Saves the current table into PDF file.

Params:

Name Type Description
paperSize string Any paper format like 'a0', 'tabloid', 'b4', etc.
landscape boolean Define, is landscape.
x number Offset X.
y number Offset Y.

Try it:

saveAsPng

Saves the current table into PNG file.

Params:

Name Type Description
width number Image width.
height number Image height.
quality number Image quality in ratio 0-1.

Try it:

saveAsSvg

Saves the current table into SVG file with a paper size and landscape settings.

Params:

Name Type Description
paperSize string Paper Size.
landscape boolean Landscape.

Try it:

Saves the current visual state into SVG file image width and height.

Params:

Name Type Description
width number Image width.
height number Image height.

Try it:

selectable

Getter for the text selectable option.

Returns:

boolean - The current text selectable option.
Setter for the text selectable.

Params:

Name Type Default Description
value boolean
false
Value to set.

Returns:

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

Try it:

shareAsJpg

Shares a table as a JPG file and returns a link to the shared image.

Params:

Name Type Description
onSuccess function Function that is called when sharing is complete.
onError function Function that is called if sharing fails.
asBase64 boolean Share as base64 file.
width number Image width.
height number Image height.
quality number Image quality in ratio 0-1.
forceTransparentWhite boolean Force transparent to white or not.
filename string File name to save.

Try it:

shareAsPdf

Shares a table as a PDF file and returns a link to the shared image.

Params:

Name Type Description
onSuccess function Function that is called when sharing is complete.
onError function Function that is called if sharing fails.
asBase64 boolean Share as base64 file.
paperSizeOrWidth number | string Any paper format like 'a0', 'tabloid', 'b4', etc.
landscapeOrWidth number | boolean Define, is landscape.
x number Offset X.
y number Offset Y.
filename string File name to save.

Try it:

shareAsPng

Shares a table as a PNG file and returns a link to the shared image.

Params:

Name Type Description
onSuccess function Function that is called when sharing is complete.
onError function Function that is called if sharing fails.
asBase64 boolean Share as base64 file.
width number Image width.
height number Image height.
quality number Image quality in ratio 0-1.
filename string File name to save.

Try it:

shareAsSvg

Shares a table as a SVG file and returns a link to the shared image.

Params:

Name Type Description
onSuccess function Function that is called when sharing is complete.
onError function Function that is called if sharing fails.
asBase64 boolean Share as base64 file.
paperSizeOrWidth string | number Paper Size or width.
landscapeOrHeight boolean | string Landscape or height.
filename string File name to save.

Try it:

textDirection

Getter for the text direction.

Returns:

anychart.graphics.vector.Text.Direction string - Current text direction.
Setter for the text direction.

Params:

Name Type Default Description
value anychart.graphics.vector.Text.Direction | string
anychart.graphics.vector.Text.Direction#LTR
Value to set.

Returns:

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

Try it:

textIndent

Getter for the text indent.

Returns:

number - The current text indent.
Setter for the text indent.

Params:

Name Type Description
value number Value to set.

Returns:

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

Try it:

textOverflow

Getter for the text overflow settings.

Returns:

anychart.graphics.vector.Text.TextOverflow string - The current text overflow settings.
Setter for the text overflow settings.

Params:

Name Type Default Description
value anychart.graphics.vector.Text.TextOverflow | string
anychart.graphics.vector.Text.TextOverflow#CLIP
Value to set.

Returns:

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

Try it:

textWrap

Getter for the text wrap settings.

Returns:

anychart.graphics.vector.Text.TextWrap string - Th current text wrap settings.
Setter for the text wrap settings.

Params:

Name Type Default Description
value anychart.graphics.vector.Text.TextWrap | string
anychart.graphics.vector.Text.TextWrap#BY_LETTER
Value to set.

Returns:

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

Try it:

toSvg

Returns SVG string if type of content SVG with parameters otherwise returns empty string.

Params:

Name Type Description
paperSize string Paper Size.
landscape boolean Landscape.

Returns:

string - SVG string or empty string.

Try it:

Returns SVG string if type of content SVG with determined the width and height otherwise returns empty string.

Params:

Name Type Description
width number Paper Size or width.
height number Landscape or height.

Returns:

string - SVG string or empty string.

Try it:

top

Getter for element top bound setting.

Returns:

number string undefined - Current element's top bound setting.
Sets element top bound setting.

Params:

Name Type Default Description
value number | string | null
null
Top bound setting for the element.

Returns:

anychart.core.VisualBaseWithBounds - Returns self for method chaining.

Try it:

unlisten

Removes a listener added using listen() or listenOnce() methods.

Params:

Name Type Description
type string The event type id.
listener function Callback method.
useCapture boolean Whether to fire in capture phase (defaults to false).
listenerScope Object Object in whose scope to call the listener.

Returns:

boolean - Whether any listener was removed.

Try it:

unlistenByKey

Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().

Params:

Name Type Description
key Object The key returned by listen() or listenOnce().

Returns:

boolean - Whether any listener was removed.

Try it:

useHtml

Getter for the useHtml flag.

Returns:

boolean - The current value of useHTML flag.
Setter for flag useHtml.

Params:

Name Type Default Description
value boolean
false
Value to set.

Returns:

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

Try it:

vAlign

Getter for the text vertical align.

Returns:

anychart.graphics.vector.Text.VAlign string - The current text vertical align.
Setter for the text vertical align.

Params:

Name Type Default Description
value anychart.graphics.vector.Text.VAlign | string
anychart.graphics.vector.Text.VAlign#TOP
Value to set.

Returns:

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

Try it:

width

Getter for element width setting.

Returns:

number string undefined - Current element's width setting.
Sets element width setting.

Params:

Name Type Default Description
value number | string | null
null
Width setting for the element.

Returns:

anychart.core.VisualBaseWithBounds - Returns self for method chaining.

Try it:

zIndex

Getter for the current Z-index of the element.

Returns:

number - The current zIndex.

Try it:

Setter for the Z-index of the element.

Params:

Name Type Default Description
value number
0
Value to set.

Returns:

anychart.core.VisualBase - Self instance for method chaining.

Try it: