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
Property | Type | Description |
---|---|---|
font | Font | Readonly. Gets a Font object which represents the font setting of the specified chart data table. |
autoScaleFont | boolean | True if the text in the object changes font size when the object size changes. The default value is True. |
backgroundMode | BackgroundMode | Gets and sets the display mode of the background |
hasBorderHorizontal | boolean | True if the chart data table has horizontal cell borders |
hasHorizontalBorder | boolean | True if the chart data table has horizontal cell borders |
hasBorderVertical | boolean | True if the chart data table has vertical cell borders |
hasVerticalBorder | boolean | True if the chart data table has vertical cell borders |
hasBorderOutline | boolean | True if the chart data table has outline borders |
hasOutlineBorder | boolean | True if the chart data table has outline borders |
showLegendKey | boolean | True if the data label legend key is visible. |
border | Line | Readonly. Returns a Border object that represents the border of the object |
Methods
Method | Description |
---|---|
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
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:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
getBackgroundMode()
@deprecated. Please use the ‘backgroundMode’ property instead. Gets and sets the display mode of the background
getBackgroundMode() : BackgroundMode;
Returns
setBackgroundMode(BackgroundMode)
@deprecated. Please use the ‘backgroundMode’ property instead. Gets and sets the display mode of the background
setBackgroundMode(value: BackgroundMode) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | BackgroundMode | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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
isNull()
Checks whether the implementation object is null.
isNull() : boolean;