ChartDataTable

Inheritance: java.lang.Object

public class ChartDataTable

Represents a chart data table.

Example

         //Instantiating a Workbook object
         Workbook workbook = new Workbook();
 
         //Obtaining the reference of the first worksheet
         Worksheet 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
         int chartIndex = worksheet.getCharts().add(ChartType.COLUMN, 5, 0, 25, 10);
 
         //Accessing the instance of the newly added chart
         Chart 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
         ChartDataTable chartTable = chart.getChartDataTable();
 
         //Setting Chart Table Font Color
         chartTable.getFont().setColor(com.aspose.cells.Color.getRed());
 
         //Setting Legend Key VisibilityOptions
         chartTable.setShowLegendKey(false);
 
         //Saving the Excel file
         workbook.save("book1.xls");

Methods

MethodDescription
equals(Object arg0)
getAutoScaleFont()True if the text in the object changes font size when the object size changes.
getBackground()Gets the display mode of the background
getBackgroundMode()Gets the display mode of the background
getBorder()Returns a Border object that represents the border of the object
getClass()
getFont()Gets a ChartArea.getFont() object which represents the font setting of the specified chart data table.
getShowLegendKey()True if the data label legend key is visible.
hasBorderHorizontal()True if the chart data table has horizontal cell borders
hasBorderOutline()True if the chart data table has outline borders
hasBorderVertical()True if the chart data table has vertical cell borders
hashCode()
notify()
notifyAll()
setAutoScaleFont(boolean value)True if the text in the object changes font size when the object size changes.
setBackground(int value)Sets the display mode of the background
setBackgroundMode(int value)Sets the display mode of the background
setHasBorderHorizontal(boolean value)True if the chart data table has horizontal cell borders
setHasBorderOutline(boolean value)True if the chart data table has outline borders
setHasBorderVertical(boolean value)True if the chart data table has vertical cell borders
setShowLegendKey(boolean value)True if the data label legend key is visible.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getAutoScaleFont()

public boolean getAutoScaleFont()

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

Returns: boolean

getBackground()

public int getBackground()

Gets the display mode of the background

See BackgroundMode.

Remarks

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

Returns: int

getBackgroundMode()

public int getBackgroundMode()

Gets the display mode of the background

See BackgroundMode.

Returns: int

getBorder()

public Line getBorder()

Returns a Border object that represents the border of the object

Returns: Line

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getFont()

public Font getFont()

Gets a ChartArea.getFont() object which represents the font setting of the specified chart data table.

Returns: Font

getShowLegendKey()

public boolean getShowLegendKey()

True if the data label legend key is visible.

Returns: boolean

hasBorderHorizontal()

public boolean hasBorderHorizontal()

True if the chart data table has horizontal cell borders

Returns: boolean

hasBorderOutline()

public boolean hasBorderOutline()

True if the chart data table has outline borders

Returns: boolean

hasBorderVertical()

public boolean hasBorderVertical()

True if the chart data table has vertical cell borders

Returns: boolean

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setAutoScaleFont(boolean value)

public void setAutoScaleFont(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setBackground(int value)

public void setBackground(int value)

Sets the display mode of the background

See BackgroundMode.

Remarks

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

Parameters:

ParameterTypeDescription
valueint

setBackgroundMode(int value)

public void setBackgroundMode(int value)

Sets the display mode of the background

See BackgroundMode.

Parameters:

ParameterTypeDescription
valueint

setHasBorderHorizontal(boolean value)

public void setHasBorderHorizontal(boolean value)

True if the chart data table has horizontal cell borders

Parameters:

ParameterTypeDescription
valueboolean

setHasBorderOutline(boolean value)

public void setHasBorderOutline(boolean value)

True if the chart data table has outline borders

Parameters:

ParameterTypeDescription
valueboolean

setHasBorderVertical(boolean value)

public void setHasBorderVertical(boolean value)

True if the chart data table has vertical cell borders

Parameters:

ParameterTypeDescription
valueboolean

setShowLegendKey(boolean value)

public void setShowLegendKey(boolean value)

True if the data label legend key is visible.

Parameters:

ParameterTypeDescription
valueboolean

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int