java.lang.Object
com.aspose.words.ChartDataTable
- All Implemented Interfaces:
- java.lang.Cloneable
public class ChartDataTable
- extends java.lang.Object
Allows to specify properties of a chart data table.
Example:
Shows how to show data table with chart series data.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.insertChart(ChartType.COLUMN, 432.0, 252.0);
Chart chart = shape.getChart();
ChartSeriesCollection series = chart.getSeries();
series.clear();
double[] xValues = new double[] { 2020.0, 2021.0, 2022.0, 2023.0 };
series.add("Series1", xValues, new double[] { 5.0, 11.0, 2.0, 7.0 });
series.add("Series2", xValues, new double[] { 6.0, 5.5, 7.0, 7.8 });
series.add("Series3", xValues, new double[] { 10.0, 8.0, 7.0, 9.0 });
ChartDataTable dataTable = chart.getDataTable();
dataTable.setShow(true);
dataTable.hasLegendKeys(false);
dataTable.hasHorizontalBorder(false);
dataTable.hasVerticalBorder(false);
dataTable.getFont().setItalic(true);
dataTable.getFormat().getStroke().setWeight(1.0);
dataTable.getFormat().getStroke().setDashStyle(DashStyle.SHORT_DOT);
dataTable.getFormat().getStroke().setColor(Color.BLUE);
doc.save(getArtifactsDir() + "Charts.DataTable.docx");
|
Property Getters/Setters Summary |
Font | getFont() | |
|
Provides access to font formatting of the data table.
|
ChartFormat | getFormat() | |
|
Provides access to fill of text background and border formatting of the data table.
|
boolean | hasHorizontalBorder() | |
void | hasHorizontalBorder(boolean value) | |
|
Gets or sets a flag indicating whether a horizontal border of the data table is displayed.
The default value is true.
|
boolean | hasLegendKeys() | |
void | hasLegendKeys(boolean value) | |
|
Gets or sets a flag indicating whether legend keys are displayed in the data table.
The default value is true.
|
boolean | hasOutlineBorder() | |
void | hasOutlineBorder(boolean value) | |
|
Gets or sets a flag indicating whether an outline border, that is, a border around series and category names,
is displayed.
The default value is true.
|
boolean | hasVerticalBorder() | |
void | hasVerticalBorder(boolean value) | |
|
Gets or sets a flag indicating whether a vertical border of the data table is displayed.
The default value is true.
|
boolean | getShow() | |
void | setShow(boolean value) | |
|
Gets or sets a flag indicating whether the data table will be shown for the chart.
Default value is false.
|
|
Property Getters/Setters Detail |
getFont | |
public Font getFont()
|
-
Provides access to font formatting of the data table.
-
Provides access to fill of text background and border formatting of the data table.
hasHorizontalBorder/hasHorizontalBorder | |
public boolean hasHorizontalBorder() / public void hasHorizontalBorder(boolean value)
|
-
Gets or sets a flag indicating whether a horizontal border of the data table is displayed.
The default value is
true.
hasLegendKeys/hasLegendKeys | |
public boolean hasLegendKeys() / public void hasLegendKeys(boolean value)
|
-
Gets or sets a flag indicating whether legend keys are displayed in the data table.
The default value is
true.
hasOutlineBorder/hasOutlineBorder | |
public boolean hasOutlineBorder() / public void hasOutlineBorder(boolean value)
|
-
Gets or sets a flag indicating whether an outline border, that is, a border around series and category names,
is displayed.
The default value is
true.
hasVerticalBorder/hasVerticalBorder | |
public boolean hasVerticalBorder() / public void hasVerticalBorder(boolean value)
|
-
Gets or sets a flag indicating whether a vertical border of the data table is displayed.
The default value is
true.
getShow/setShow | |
public boolean getShow() / public void setShow(boolean value)
|
-
Gets or sets a flag indicating whether the data table will be shown for the chart.
Default value is
false.
The following chart types do not support data tables: Scatter, Pie, Doughnut, Surface, Radar, Treemap,
Sunburst, Histogram, Pareto, Box and Whisker, Waterfall, Funnel, Combo charts that include series of
these types. Showing a data table for the chart types throws a java.lang.IllegalStateException
exception.
Example:
Shows how to show data table with chart series data.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.insertChart(ChartType.COLUMN, 432.0, 252.0);
Chart chart = shape.getChart();
ChartSeriesCollection series = chart.getSeries();
series.clear();
double[] xValues = new double[] { 2020.0, 2021.0, 2022.0, 2023.0 };
series.add("Series1", xValues, new double[] { 5.0, 11.0, 2.0, 7.0 });
series.add("Series2", xValues, new double[] { 6.0, 5.5, 7.0, 7.8 });
series.add("Series3", xValues, new double[] { 10.0, 8.0, 7.0, 9.0 });
ChartDataTable dataTable = chart.getDataTable();
dataTable.setShow(true);
dataTable.hasLegendKeys(false);
dataTable.hasHorizontalBorder(false);
dataTable.hasVerticalBorder(false);
dataTable.getFont().setItalic(true);
dataTable.getFormat().getStroke().setWeight(1.0);
dataTable.getFormat().getStroke().setDashStyle(DashStyle.SHORT_DOT);
dataTable.getFormat().getStroke().setColor(Color.BLUE);
doc.save(getArtifactsDir() + "Charts.DataTable.docx");
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.