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.getWorksheets().get(0);
//Adding a sample value to "A1" cell
worksheet.getCells().get("A1").putValue(50);
//Adding a sample value to "A2" cell
worksheet.getCells().get("A2").putValue(100);
//Adding a sample value to "A3" cell
worksheet.getCells().get("A3").putValue(150);
//Adding a sample value to "B1" cell
worksheet.getCells().get("B1").putValue(60);
//Adding a sample value to "B2" cell
worksheet.getCells().get("B2").putValue(32);
//Adding a sample value to "B3" cell
worksheet.getCells().get("B3").putValue(50);
//Adding a chart to the worksheet
var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 25, 10);
//Accessing the instance of the newly added chart
var chart = worksheet.getCharts().get(chartIndex);
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
chart.getNSeries().add("A1:B3", true);
chart.setShowDataTable(true);
//Getting Chart Table
var chartTable = chart.getChartDataTable();
//Setting Chart Table Font Color
chartTable.getFont().setColor(Color.Red);
//Setting Legend Key Visibility
chartTable.setShowLegendKey(false);
//Saving the Excel file
workbook.save("output/ChartsChartDataTable.xls");

Methods

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

getFont()

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

getFont() : Font;

Returns

Font

getAutoScaleFont()

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

getAutoScaleFont() : boolean;

setAutoScaleFont(boolean)

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()

Gets and sets the display mode of the background

getBackgroundMode() : BackgroundMode;

Returns

BackgroundMode

setBackgroundMode(BackgroundMode)

Gets and sets the display mode of the background

setBackgroundMode(value: BackgroundMode) : void;

Parameters:

ParameterTypeDescription
valueBackgroundModeThe value to set.

getHasBorderHorizontal()

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)

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()

True if the chart data table has horizontal cell borders

getHasHorizontalBorder() : boolean;

setHasHorizontalBorder(boolean)

True if the chart data table has horizontal cell borders

setHasHorizontalBorder(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getHasBorderVertical()

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)

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()

True if the chart data table has vertical cell borders

getHasVerticalBorder() : boolean;

setHasVerticalBorder(boolean)

True if the chart data table has vertical cell borders

setHasVerticalBorder(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getHasBorderOutline()

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)

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()

True if the chart data table has outline borders

getHasOutlineBorder() : boolean;

setHasOutlineBorder(boolean)

True if the chart data table has outline borders

setHasOutlineBorder(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getShowLegendKey()

True if the data label legend key is visible.

getShowLegendKey() : boolean;

setShowLegendKey(boolean)

True if the data label legend key is visible.

setShowLegendKey(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getBorder()

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;