ChartStyle

Inheritance: java.lang.Object

public class ChartStyle

Specifies predefined styles of a chart.

Examples:

Shows how to set and get chart style.


 Document doc = new Document();
 DocumentBuilder builder = new DocumentBuilder(doc);

 // Insert a chart in the Black style.
 builder.insertChart(ChartType.COLUMN, 400.0, 250.0, ChartStyle.BLACK);

 doc.save(getArtifactsDir() + "Charts.SetChartStyle.docx");

 doc = new Document(getArtifactsDir() + "Charts.SetChartStyle.docx");

 // Get a chart to update.
 Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
 Chart chart = shape.getChart();

 // Get the chart style.
 Assert.assertEquals(ChartStyle.BLACK, chart.getStyle());
 

Fields

FieldDescription
BLACKA style with black chart background.
BLUEA style with blue chart background.
FLATA style with flat data points without gradient.
GRADIENTA style with gradient fill of data points.
GREYA style with gray gradient chart background.
MUTEDA style with muted colors.
NORMALRepresents the default chart style.
ORIGINALA style with an original appearance of a chart.
OUTLINEA style with data points having no fill, but only an outline.
OUTLINE_BLACKA style with black chart background, in which data points have no fill, but only an outline.
SATURATEDA style with more saturated colors.
SHADEDA style with shaded data points.
SHADED_PLOTA style, in which the plot area is shaded.
SHADOWEDA style with data points having a shadow.
TRANSPARENT_1A style with transparent data points.
TRANSPARENT_2A style with transparent data points.
length

Methods

MethodDescription
fromName(String chartStyleName)
getName(int chartStyle)
getValues()
toString(int chartStyle)

BLACK

public static int BLACK

A style with black chart background.

BLUE

public static int BLUE

A style with blue chart background.

FLAT

public static int FLAT

A style with flat data points without gradient.

GRADIENT

public static int GRADIENT

A style with gradient fill of data points.

GREY

public static int GREY

A style with gray gradient chart background.

MUTED

public static int MUTED

A style with muted colors.

NORMAL

public static int NORMAL

Represents the default chart style.

ORIGINAL

public static int ORIGINAL

A style with an original appearance of a chart.

OUTLINE

public static int OUTLINE

A style with data points having no fill, but only an outline.

OUTLINE_BLACK

public static int OUTLINE_BLACK

A style with black chart background, in which data points have no fill, but only an outline.

SATURATED

public static int SATURATED

A style with more saturated colors.

SHADED

public static int SHADED

A style with shaded data points.

SHADED_PLOT

public static int SHADED_PLOT

A style, in which the plot area is shaded.

SHADOWED

public static int SHADOWED

A style with data points having a shadow.

TRANSPARENT_1

public static int TRANSPARENT_1

A style with transparent data points.

TRANSPARENT_2

public static int TRANSPARENT_2

A style with transparent data points.

length

public static int length

fromName(String chartStyleName)

public static int fromName(String chartStyleName)

Parameters:

ParameterTypeDescription
chartStyleNamejava.lang.String

Returns: int

getName(int chartStyle)

public static String getName(int chartStyle)

Parameters:

ParameterTypeDescription
chartStyleint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int chartStyle)

public static String toString(int chartStyle)

Parameters:

ParameterTypeDescription
chartStyleint

Returns: java.lang.String