AnyChart
API Reference
Still have questions?
Contact support
Top
You are looking at an outdated v7 version of this document. Switch to the v8 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:

NameTypeDefaultDescription
coloranychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null
Stroke settings.
thicknessnumber
1
Line thickness.
dashpatternstring
Controls the pattern of dashes and gaps used to stroke paths.
lineJoinanychart.graphics.vector.StrokeLineJoin
Line join style.
lineCapanychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

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

bottom

Getter for element bottom bound setting.

Returns:

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

Params:

NameTypeDefaultDescription
valuenumber | string | null
null
Bottom bound setting for the element.

Returns:

anychart.core.ui.Table - Returns self for method chaining.

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:

NameTypeDescription
valueanychart.utils.RectObj | anychart.math.Rect | anychart.core.utils.BoundsBounds of element.

Returns:

anychart.core.ui.Table - Self instance for method chaining.
Setter for the element bounds settings.

Params:

NameTypeDefaultDescription
xnumber | string
null
X-coordinate.
ynumber | string
null
Y-coordinate.
widthnumber | string
null
Width.
heightnumber | string
null
Height.

Returns:

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

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:

NameTypeDefaultDescription
strokeOrFillanychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Fill settings or stroke settings.
thicknessnumber
1
Line thickness.
dashpatternstring
Controls the pattern of dashes and gaps used to stroke paths.
lineJoinanychart.graphics.vector.StrokeLineJoin
Line join style.
lineCapanychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

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

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:

NameTypeDefaultDescription
valueanychart.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:

NameTypeDescription
colorstringColor as a string.
opacitynumberColor opacity.

Returns:

anychart.core.ui.Table - Self instance for method chaining.
Linear gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Gradient keys.
anglenumberGradient angle.
modeboolean | anychart.graphics.vector.Rect | ObjectGradient mode.
opacitynumberGradient opacity.

Returns:

anychart.core.ui.Table - Self instance for method chaining.
Radial gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Color-stop gradient keys.
cxnumberX ratio of center radial gradient.
cynumberY ratio of center radial gradient.
modeanychart.graphics.math.RectIf defined then userSpaceOnUse mode, else objectBoundingBox.
opacitynumberOpacity of the gradient.
fxnumberX ratio of focal point.
fynumberY ratio of focal point.

Returns:

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

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject with settings.

Returns:

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

cellPadding

Setter for cell paddings in pixels using a single value.

Params:

NameTypeDescription
valuenull | Array.<(number|string)> | ObjectValue 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));
Setter for cell paddings in pixels using several numbers.

Params:

NameTypeDescription
value1string | numberTop or top-bottom space.
value2string | numberRight or right-left space.
value3string | numberBottom space.
value4string | numberLeft 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);

colsCount

Getter for table columns count.

Returns:

number - Current columns count.
Setter for table columns count.

Params:

NameTypeDefaultDescription
valuenumber
4
Value to set.

Returns:

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

colsMaxWidth

Getter for default column width maximum settings.

Returns:

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

Params:

NameTypeDefaultDescription
valuestring | number | null
null
Value to set.

Returns:

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

colsMinWidth

Getter for default column width minimum settings.

Returns:

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

Params:

NameTypeDefaultDescription
valuestring | number | null
null
Value to set.

Returns:

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

colsWidth

Getter for default column width settings.

Returns:

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

Params:

NameTypeDefaultDescription
valuestring | number | null
null
Value to set.

Returns:

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

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:

NameTypeDefaultDescription
tableValuesArray.<Array.<(anychart.core.VisualBase|string|number|undefined)>>
Values to set.
demergeCellsboolean
false
Pass true to demerge all cells.

Returns:

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

disablePointerEvents

Gets current state of disablePointerEvents option.

Returns:

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

Params:

NameTypeDefaultDescription
valueboolean
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.

enabled

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

Returns:

boolean - The current element state.
Setter for the element enabled state.

Params:

NameTypeDefaultDescription
valueboolean
true
Value to set.

Returns:

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

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:

NameTypeDescription
valuestringValue to set.

Returns:

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

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:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.Decoration | string
anychart.graphics.vector.Text.Decoration#NONE
Value to set.

Returns:

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

fontFamily

Getter for the font family.

Returns:

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

Params:

NameTypeDescription
valuestringValue to set.

Returns:

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

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:

NameTypeDescription
valuenumberValue to set.

Returns:

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

fontSize

Getter for text font size.

Returns:

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

Params:

NameTypeDescription
valuestring | numberValue to set.

Returns:

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

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:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.FontStyle | string
anychart.graphics.vector.Text.FontStyle#NORMAL
Value to set.

Returns:

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

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:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.FontVariant | string
anychart.graphics.vector.Text.FontVariant#NORMAL
Value to set.

Returns:

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

fontWeight

Getter for the text font weight.

Returns:

string | number - The current font weight.

Params:

NameTypeDescription
valuestring | numberValue to set.

Returns:

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

getCell

Returns cell by its row and column number.

Params:

NameTypeDescription
rownumberRow index.
colnumberColumn index.

Returns:

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

getCol

Returns column instance by its number.

Params:

NameTypeDescription
colnumberA column by number

Returns:

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

getJpgBase64String

Returns JPG as base64 string.

Params:

NameTypeDescription
onSuccessfunctionFunction that is called when sharing is complete.
onErrorfunctionFunction that is called if sharing fails.
widthnumberImage width.
heightnumberImage height.
qualitynumberImage quality in ratio 0-1.
forceTransparentWhitebooleanForce transparent to white or not.

getPdfBase64String

Returns PDF as base64 string.

Params:

NameTypeDescription
onSuccessfunctionFunction that is called when sharing is complete.
onErrorfunctionFunction that is called if sharing fails.
paperSizeOrWidthnumber | stringAny paper format like 'a0', 'tabloid', 'b4', etc.
landscapeOrWidthnumber | booleanDefine, is landscape.
xnumberOffset X.
ynumberOffset Y.

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:

NameTypeDescription
onSuccessfunctionFunction that is called when sharing is complete.
onErrorfunctionFunction that is called if sharing fails.
widthnumberImage width.
heightnumberImage height.
qualitynumberImage quality in ratio 0-1.

getRow

Returns row instance by its number.

Params:

NameTypeDescription
rownumberA row by number.

Returns:

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

getSvgBase64String

Returns SVG as base64 string.

Params:

NameTypeDescription
onSuccessfunctionFunction that is called when sharing is complete.
onErrorfunctionFunction that is called if sharing fails.
paperSizeOrWidthstring | numberPaper Size or width.
landscapeOrHeightboolean | stringLandscape or height.

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:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.HAlign | string
anychart.graphics.vector.Text.HAlign#START
Value to set.

Returns:

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

height

Getter for element height setting.

Returns:

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

Params:

NameTypeDefaultDescription
valuenumber | string | null
null
Height setting for the element.

Returns:

anychart.core.ui.Table - Returns self for method chaining.

left

Getter for element left bound setting.

Returns:

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

Params:

NameTypeDefaultDescription
valuenumber | string | null
null
Left bound setting for the element.

Returns:

anychart.core.ui.Table - Returns self for method chaining.

letterSpacing

Getter for the text letter spacing.

Returns:

string | number - The current letter spacing.

Params:

NameTypeDescription
valuestring | numberValue to set.

Returns:

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

lineHeight

Getter for the text line height.

Returns:

string | number - The current text line height.

Params:

NameTypeDescription
valuestring | numberValue to set.

Returns:

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

listen

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction
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 }.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

listenOnce

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction
Callback method.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

maxHeight

Getter for maximum height.

Returns:

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

Params:

NameTypeDefaultDescription
valuenumber | string | null
null
Value to set.

Returns:

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

maxWidth

Getter for maximum width.

Returns:

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

Params:

NameTypeDefaultDescription
valuenumber | string | null
null
Value to set.

Returns:

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

minHeight

Getter for minimum height.

Returns:

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

Params:

NameTypeDefaultDescription
valuenumber | string | null
null
Value to set.

Returns:

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

minWidth

Getter for minimum width.

Returns:

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

Params:

NameTypeDefaultDescription
valuenumber | string | null
null
Value to set.

Returns:

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

print

Prints all elements on related stage.

Params:

NameTypeDefaultDescription
paperSizeOrOptionsanychart.graphics.vector.PaperSize | Object
Paper size or object with options.
landscapeboolean
false
Flag of landscape.

removeAllListeners

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

Params:

NameTypeDescription
typestringType of event to remove, default is to remove all types.

Returns:

number - Number of listeners removed.
Getter for element right bound setting.

Returns:

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

Params:

NameTypeDefaultDescription
valuenumber | string | null
null
Right bound setting for the element.

Returns:

anychart.core.ui.Table - Returns self for method chaining.

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:

NameTypeDefaultDescription
valueanychart.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:

NameTypeDescription
colorstringColor as a string.
opacitynumberColor opacity.

Returns:

anychart.core.ui.Table - Self instance for method chaining.
Linear gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Gradient keys.
anglenumberGradient angle.
modeboolean | anychart.graphics.vector.Rect | ObjectGradient mode.
opacitynumberGradient opacity.

Returns:

anychart.core.ui.Table - Self instance for method chaining.
Radial gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Color-stop gradient keys.
cxnumberX ratio of center radial gradient.
cynumberY ratio of center radial gradient.
modeanychart.graphics.math.RectIf defined then userSpaceOnUse mode, else objectBoundingBox.
opacitynumberOpacity of the gradient.
fxnumberX ratio of focal point.
fynumberY ratio of focal point.

Returns:

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

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject with settings.

Returns:

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

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:

NameTypeDefaultDescription
valueanychart.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:

NameTypeDescription
colorstringColor as a string.
opacitynumberColor opacity.

Returns:

anychart.core.ui.Table - Self instance for method chaining.
Linear gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Gradient keys.
anglenumberGradient angle.
modeboolean | anychart.graphics.vector.Rect | ObjectGradient mode.
opacitynumberGradient opacity.

Returns:

anychart.core.ui.Table - Self instance for method chaining.
Radial gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Color-stop gradient keys.
cxnumberX ratio of center radial gradient.
cynumberY ratio of center radial gradient.
modeanychart.graphics.math.RectIf defined then userSpaceOnUse mode, else objectBoundingBox.
opacitynumberOpacity of the gradient.
fxnumberX ratio of focal point.
fynumberY ratio of focal point.

Returns:

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

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject with settings.

Returns:

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

rowsCount

Getter for table rows count.

Returns:

number - Current rows count.
Setter for table rows count.

Params:

NameTypeDefaultDescription
valuenumber
5
Value to set.

Returns:

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

rowsHeight

Getter for default row height settings.

Returns:

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

Params:

NameTypeDefaultDescription
valuestring | number | null
null
Value to set.

Returns:

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

rowsMaxHeight

Getter for default row height maximum settings.

Returns:

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

Params:

NameTypeDefaultDescription
valuestring | number | null
null
Value to set.

Returns:

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

rowsMinHeight

Getter for default row height minimum settings.

Returns:

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

Params:

NameTypeDefaultDescription
valuestring | number | null
null
Value to set.

Returns:

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

saveAsJpg

Saves the current table into JPEG file.

Params:

NameTypeDescription
widthnumberImage width.
heightnumberImage height.
qualitynumberImage quality in ratio 0-1.
forceTransparentWhitebooleanForce transparent to white or not.

saveAsPdf

Saves the current table into PDF file.

Params:

NameTypeDescription
paperSizestringAny paper format like 'a0', 'tabloid', 'b4', etc.
landscapebooleanDefine, is landscape.
xnumberOffset X.
ynumberOffset Y.

saveAsPng

Saves the current table into PNG file.

Params:

NameTypeDescription
widthnumberImage width.
heightnumberImage height.
qualitynumberImage quality in ratio 0-1.

saveAsSvg

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

Params:

NameTypeDescription
paperSizestringPaper Size.
landscapebooleanLandscape.
Saves the current visual state into SVG file image width and height.

Params:

NameTypeDescription
widthnumberImage width.
heightnumberImage height.

selectable

Getter for the text selectable option.

Returns:

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

Params:

NameTypeDefaultDescription
valueboolean
false
Value to set.

Returns:

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

shareAsJpg

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

Params:

NameTypeDescription
onSuccessfunctionFunction that is called when sharing is complete.
onErrorfunctionFunction that is called if sharing fails.
asBase64booleanShare as base64 file.
widthnumberImage width.
heightnumberImage height.
qualitynumberImage quality in ratio 0-1.
forceTransparentWhitebooleanForce transparent to white or not.
filenamestringFile name to save.

shareAsPdf

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

Params:

NameTypeDescription
onSuccessfunctionFunction that is called when sharing is complete.
onErrorfunctionFunction that is called if sharing fails.
asBase64booleanShare as base64 file.
paperSizeOrWidthnumber | stringAny paper format like 'a0', 'tabloid', 'b4', etc.
landscapeOrWidthnumber | booleanDefine, is landscape.
xnumberOffset X.
ynumberOffset Y.
filenamestringFile name to save.

shareAsPng

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

Params:

NameTypeDescription
onSuccessfunctionFunction that is called when sharing is complete.
onErrorfunctionFunction that is called if sharing fails.
asBase64booleanShare as base64 file.
widthnumberImage width.
heightnumberImage height.
qualitynumberImage quality in ratio 0-1.
filenamestringFile name to save.

shareAsSvg

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

Params:

NameTypeDescription
onSuccessfunctionFunction that is called when sharing is complete.
onErrorfunctionFunction that is called if sharing fails.
asBase64booleanShare as base64 file.
paperSizeOrWidthstring | numberPaper Size or width.
landscapeOrHeightboolean | stringLandscape or height.
filenamestringFile name to save.

textDirection

Getter for the text direction.

Returns:

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

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.Direction | string
anychart.graphics.vector.Text.Direction#LTR
Value to set.

Returns:

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

textIndent

Getter for the text indent.

Returns:

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

Params:

NameTypeDescription
valuenumberValue to set.

Returns:

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

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:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.TextOverflow | string
anychart.graphics.vector.Text.TextOverflow#CLIP
Value to set.

Returns:

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

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:

NameTypeDefaultDescription
valueanychart.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.

toSvg

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

Params:

NameTypeDescription
paperSizestringPaper Size.
landscapebooleanLandscape.

Returns:

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

Params:

NameTypeDescription
widthnumberPaper Size or width.
heightnumberLandscape or height.

Returns:

string - SVG string or empty string.

top

Getter for element top bound setting.

Returns:

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

Params:

NameTypeDefaultDescription
valuenumber | string | null
null
Top bound setting for the element.

Returns:

anychart.core.ui.Table - Returns self for method chaining.

unlisten

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

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction
Callback method.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

boolean - Whether any listener was removed.

unlistenByKey

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

Params:

NameTypeDescription
keyObjectThe key returned by listen() or listenOnce().

Returns:

boolean - Whether any listener was removed.

useHtml

Getter for the useHtml flag.

Returns:

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

Params:

NameTypeDefaultDescription
valueboolean
false
Value to set.

Returns:

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

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:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.VAlign | string
anychart.graphics.vector.Text.VAlign#TOP
Value to set.

Returns:

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

width

Getter for element width setting.

Returns:

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

Params:

NameTypeDefaultDescription
valuenumber | string | null
null
Width setting for the element.

Returns:

anychart.core.ui.Table - Returns self for method chaining.

zIndex

Getter for the current Z-index of the element.

Returns:

number - The current zIndex.
Setter for the Z-index of the element.

Params:

NameTypeDefaultDescription
valuenumber
0
Value to set.

Returns:

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