ChartDataTable

ChartDataTable class

Represents a chart data table.

class ChartDataTable;

Example

const { Workbook, ChartType, Color } = require("aspose.cells.node");

//Instantiating a Workbook object
var workbook = new Workbook();
//Obtaining the reference of the first worksheet
var worksheet = workbook.worksheets.get(0);
//Adding a sample value to "A1" cell
worksheet.cells.get("A1").putValue(50);
//Adding a sample value to "A2" cell
worksheet.cells.get("A2").putValue(100);
//Adding a sample value to "A3" cell
worksheet.cells.get("A3").putValue(150);
//Adding a sample value to "B1" cell
worksheet.cells.get("B1").putValue(60);
//Adding a sample value to "B2" cell
worksheet.cells.get("B2").putValue(32);
//Adding a sample value to "B3" cell
worksheet.cells.get("B3").putValue(50);
//Adding a chart to the worksheet
var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 25, 10);
//Accessing the instance of the newly added chart
var chart = worksheet.charts.get(chartIndex);
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
chart.nSeries.add("A1:B3", true);
chart.showDataTable = true;
//Getting Chart Table
var chartTable = chart.getChartDataTable();
//Setting Chart Table Font Color
chartTable.font.color = Color.Red;
//Setting Legend Key Visibility
chartTable.showLegendKey = false;
//Saving the Excel file
workbook.save("output/ChartsChartDataTable.xls");

Properties

PropertyTypeDescription
fontFontReadonly. Gets a Font object which represents the font setting of the specified chart data table.
autoScaleFontbooleanTrue if the text in the object changes font size when the object size changes. The default value is True.
backgroundModeBackgroundModeGets and sets the display mode of the background
hasBorderHorizontalbooleanTrue if the chart data table has horizontal cell borders
hasHorizontalBorderbooleanTrue if the chart data table has horizontal cell borders
hasBorderVerticalbooleanTrue if the chart data table has vertical cell borders
hasVerticalBorderbooleanTrue if the chart data table has vertical cell borders
hasBorderOutlinebooleanTrue if the chart data table has outline borders
hasOutlineBorderbooleanTrue if the chart data table has outline borders
showLegendKeybooleanTrue if the data label legend key is visible.
borderLineReadonly. Returns a Border object that represents the border of the object

Methods

MethodDescription
getFont()@deprecated. Please use the ‘font’ property instead. Gets a Font object which represents the font setting of the specified chart data table.
getAutoScaleFont()@deprecated. Please use the ‘autoScaleFont’ property instead. True if the text in the object changes font size when the object size changes. The default value is True.
setAutoScaleFont(boolean)@deprecated. Please use the ‘autoScaleFont’ property instead. True if the text in the object changes font size when the object size changes. The default value is True.
getBackgroundMode()@deprecated. Please use the ‘backgroundMode’ property instead. Gets and sets the display mode of the background
setBackgroundMode(BackgroundMode)@deprecated. Please use the ‘backgroundMode’ property instead. Gets and sets the display mode of the background
getHasBorderHorizontal()@deprecated. Please use the ‘hasBorderHorizontal’ property instead. True if the chart data table has horizontal cell borders
setHasBorderHorizontal(boolean)@deprecated. Please use the ‘hasBorderHorizontal’ property instead. True if the chart data table has horizontal cell borders
getHasHorizontalBorder()@deprecated. Please use the ‘hasHorizontalBorder’ property instead. True if the chart data table has horizontal cell borders
setHasHorizontalBorder(boolean)@deprecated. Please use the ‘hasHorizontalBorder’ property instead. True if the chart data table has horizontal cell borders
getHasBorderVertical()@deprecated. Please use the ‘hasBorderVertical’ property instead. True if the chart data table has vertical cell borders
setHasBorderVertical(boolean)@deprecated. Please use the ‘hasBorderVertical’ property instead. True if the chart data table has vertical cell borders
getHasVerticalBorder()@deprecated. Please use the ‘hasVerticalBorder’ property instead. True if the chart data table has vertical cell borders
setHasVerticalBorder(boolean)@deprecated. Please use the ‘hasVerticalBorder’ property instead. True if the chart data table has vertical cell borders
getHasBorderOutline()@deprecated. Please use the ‘hasBorderOutline’ property instead. True if the chart data table has outline borders
setHasBorderOutline(boolean)@deprecated. Please use the ‘hasBorderOutline’ property instead. True if the chart data table has outline borders
getHasOutlineBorder()@deprecated. Please use the ‘hasOutlineBorder’ property instead. True if the chart data table has outline borders
setHasOutlineBorder(boolean)@deprecated. Please use the ‘hasOutlineBorder’ property instead. True if the chart data table has outline borders
getShowLegendKey()@deprecated. Please use the ‘showLegendKey’ property instead. True if the data label legend key is visible.
setShowLegendKey(boolean)@deprecated. Please use the ‘showLegendKey’ property instead. True if the data label legend key is visible.
getBorder()@deprecated. Please use the ‘border’ property instead. Returns a Border object that represents the border of the object
isNull()Checks whether the implementation object is null.

font

Readonly. Gets a Font object which represents the font setting of the specified chart data table.

font : Font;

autoScaleFont

True if the text in the object changes font size when the object size changes. The default value is True.

autoScaleFont : boolean;

backgroundMode

Gets and sets the display mode of the background

backgroundMode : BackgroundMode;

hasBorderHorizontal

True if the chart data table has horizontal cell borders

hasBorderHorizontal : boolean;

Remarks

NOTE: This property is now obsolete. Instead, please use ChartDataTable.HasHorizontalBorder property. This property will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

hasHorizontalBorder

True if the chart data table has horizontal cell borders

hasHorizontalBorder : boolean;

hasBorderVertical

True if the chart data table has vertical cell borders

hasBorderVertical : boolean;

Remarks

NOTE: This property is now obsolete. Instead, please use ChartDataTable.HasVerticalBorder property. This property will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

hasVerticalBorder

True if the chart data table has vertical cell borders

hasVerticalBorder : boolean;

hasBorderOutline

True if the chart data table has outline borders

hasBorderOutline : boolean;

Remarks

NOTE: This property is now obsolete. Instead, please use ChartDataTable.HasOutlineBorder property. This property will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

hasOutlineBorder

True if the chart data table has outline borders

hasOutlineBorder : boolean;

showLegendKey

True if the data label legend key is visible.

showLegendKey : boolean;

border

Readonly. Returns a Border object that represents the border of the object

border : Line;

getFont()

@deprecated. Please use the ‘font’ property instead. Gets a Font object which represents the font setting of the specified chart data table.

getFont() : Font;

Returns

Font

getAutoScaleFont()

@deprecated. Please use the ‘autoScaleFont’ property instead. True if the text in the object changes font size when the object size changes. The default value is True.

getAutoScaleFont() : boolean;

setAutoScaleFont(boolean)

@deprecated. Please use the ‘autoScaleFont’ property instead. True if the text in the object changes font size when the object size changes. The default value is True.

setAutoScaleFont(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getBackgroundMode()

@deprecated. Please use the ‘backgroundMode’ property instead. Gets and sets the display mode of the background

getBackgroundMode() : BackgroundMode;

Returns

BackgroundMode

setBackgroundMode(BackgroundMode)

@deprecated. Please use the ‘backgroundMode’ property instead. Gets and sets the display mode of the background

setBackgroundMode(value: BackgroundMode) : void;

Parameters:

ParameterTypeDescription
valueBackgroundModeThe value to set.

getHasBorderHorizontal()

@deprecated. Please use the ‘hasBorderHorizontal’ property instead. True if the chart data table has horizontal cell borders

getHasBorderHorizontal() : boolean;

Remarks

NOTE: This property is now obsolete. Instead, please use ChartDataTable.HasHorizontalBorder property. This property will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

setHasBorderHorizontal(boolean)

@deprecated. Please use the ‘hasBorderHorizontal’ property instead. True if the chart data table has horizontal cell borders

setHasBorderHorizontal(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

NOTE: This property is now obsolete. Instead, please use ChartDataTable.HasHorizontalBorder property. This property will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

getHasHorizontalBorder()

@deprecated. Please use the ‘hasHorizontalBorder’ property instead. True if the chart data table has horizontal cell borders

getHasHorizontalBorder() : boolean;

setHasHorizontalBorder(boolean)

@deprecated. Please use the ‘hasHorizontalBorder’ property instead. True if the chart data table has horizontal cell borders

setHasHorizontalBorder(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getHasBorderVertical()

@deprecated. Please use the ‘hasBorderVertical’ property instead. True if the chart data table has vertical cell borders

getHasBorderVertical() : boolean;

Remarks

NOTE: This property is now obsolete. Instead, please use ChartDataTable.HasVerticalBorder property. This property will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

setHasBorderVertical(boolean)

@deprecated. Please use the ‘hasBorderVertical’ property instead. True if the chart data table has vertical cell borders

setHasBorderVertical(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

NOTE: This property is now obsolete. Instead, please use ChartDataTable.HasVerticalBorder property. This property will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

getHasVerticalBorder()

@deprecated. Please use the ‘hasVerticalBorder’ property instead. True if the chart data table has vertical cell borders

getHasVerticalBorder() : boolean;

setHasVerticalBorder(boolean)

@deprecated. Please use the ‘hasVerticalBorder’ property instead. True if the chart data table has vertical cell borders

setHasVerticalBorder(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getHasBorderOutline()

@deprecated. Please use the ‘hasBorderOutline’ property instead. True if the chart data table has outline borders

getHasBorderOutline() : boolean;

Remarks

NOTE: This property is now obsolete. Instead, please use ChartDataTable.HasOutlineBorder property. This property will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

setHasBorderOutline(boolean)

@deprecated. Please use the ‘hasBorderOutline’ property instead. True if the chart data table has outline borders

setHasBorderOutline(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

NOTE: This property is now obsolete. Instead, please use ChartDataTable.HasOutlineBorder property. This property will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

getHasOutlineBorder()

@deprecated. Please use the ‘hasOutlineBorder’ property instead. True if the chart data table has outline borders

getHasOutlineBorder() : boolean;

setHasOutlineBorder(boolean)

@deprecated. Please use the ‘hasOutlineBorder’ property instead. True if the chart data table has outline borders

setHasOutlineBorder(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getShowLegendKey()

@deprecated. Please use the ‘showLegendKey’ property instead. True if the data label legend key is visible.

getShowLegendKey() : boolean;

setShowLegendKey(boolean)

@deprecated. Please use the ‘showLegendKey’ property instead. True if the data label legend key is visible.

setShowLegendKey(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getBorder()

@deprecated. Please use the ‘border’ property instead. Returns a Border object that represents the border of the object

getBorder() : Line;

Returns

Line

isNull()

Checks whether the implementation object is null.

isNull() : boolean;