Class ChartOptions
- java.lang.Object
-
- com.cloudofficeprint.RenderElements.Charts.ChartOptions
-
public class ChartOptions extends java.lang.Object
This class represents the chart options.
-
-
Constructor Summary
Constructors Constructor Description ChartOptions()
This object represents the options for a chart.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBackgroundColor()
Note: displaying rounded corners is not supported by LibreOffice.java.lang.Integer
getBackgroundOpacity()
Note: backgroundOpacity is ignored if backgroundColor is not specified or if backgroundColor is specified in a color space which includes an alpha channel (e.g.java.lang.Boolean
getBorder()
java.lang.Boolean
getGrid()
java.lang.Integer
getHeight()
com.google.gson.JsonObject
getJSON()
java.lang.String
getLegendPosition()
ChartTextStyle
getLegendStyle()
java.lang.String
getPosition()
Note that not all options might be available for specific charts.java.lang.Boolean
getRoundedCorners()
java.lang.String
getSeparator()
java.lang.Boolean
getShowCategoryName()
java.lang.Boolean
getShowDataLabels()
Default true for pie/pie3d and doughnut.java.lang.Boolean
getShowLegend()
java.lang.Boolean
getShowLegendKey()
java.lang.Boolean
getShowPercentage()
java.lang.Boolean
getShowSeriesName()
java.lang.Boolean
getShowValue()
java.lang.String
getTitle()
ChartTextStyle
getTitleStyle()
java.lang.Integer
getWidth()
ChartAxisOptions
getXAxis()
ChartAxisOptions
getY2AxisOptions()
ChartAxisOptions
getYAxis()
void
removeDataLabels()
Turns the datalabels of.void
removeLegend()
Turns the legend of.void
setBackgroundColor(java.lang.String backgroundColor)
Note: displaying rounded corners is not supported by LibreOffice.void
setBackgroundOpacity(java.lang.Integer backgroundOpacity)
Note: backgroundOpacity is ignored if backgroundColor is not specified or if backgroundColor is specified in a color space which includes an alpha channel (e.g.void
setBorder(java.lang.Boolean border)
void
setDataLabels(java.lang.String separator, java.lang.Boolean showSeriesName, java.lang.Boolean showCategoryName, java.lang.Boolean showLegendKey, java.lang.Boolean showValue, java.lang.Boolean showPercentage, java.lang.String position)
Turn the data labels on.void
setGrid(java.lang.Boolean grid)
void
setHeight(java.lang.Integer height)
void
setLegend(java.lang.String position, ChartTextStyle style)
Turns the legend on.void
setRoundedCorners(java.lang.Boolean roundedCorners)
void
setTitle(java.lang.String title)
void
setTitleStyle(ChartTextStyle titleStyle)
void
setWidth(java.lang.Integer width)
void
setXAxisOptions(ChartAxisOptions xAxis)
void
setY2AxisOptions(ChartAxisOptions y2Axis)
void
setYAxisOptions(ChartAxisOptions yAxis)
-
-
-
Method Detail
-
getXAxis
public ChartAxisOptions getXAxis()
- Returns:
- The options for the x-axis.
-
setXAxisOptions
public void setXAxisOptions(ChartAxisOptions xAxis)
- Parameters:
xAxis
- The options for the x-axis.
-
getYAxis
public ChartAxisOptions getYAxis()
- Returns:
- The options for the y-axis.
-
setYAxisOptions
public void setYAxisOptions(ChartAxisOptions yAxis)
- Parameters:
yAxis
- The options for the y-axis.
-
getY2AxisOptions
public ChartAxisOptions getY2AxisOptions()
- Returns:
- The options for the second y-axis.
-
setY2AxisOptions
public void setY2AxisOptions(ChartAxisOptions y2Axis)
- Parameters:
y2Axis
- The options for the y2-axis.
-
getWidth
public java.lang.Integer getWidth()
- Returns:
- Width of the chart.
-
setWidth
public void setWidth(java.lang.Integer width)
- Parameters:
width
- Width of the chart.
-
getHeight
public java.lang.Integer getHeight()
- Returns:
- Height of the chart.
-
setHeight
public void setHeight(java.lang.Integer height)
- Parameters:
height
- Height of the chart.
-
getBorder
public java.lang.Boolean getBorder()
- Returns:
- Whether the chart should have a border.
-
setBorder
public void setBorder(java.lang.Boolean border)
- Parameters:
border
- Whether the chart should have a border.
-
getRoundedCorners
public java.lang.Boolean getRoundedCorners()
- Returns:
- Whether the chart should have rounded borders.
-
setRoundedCorners
public void setRoundedCorners(java.lang.Boolean roundedCorners)
- Parameters:
roundedCorners
- Whether the chart should have rounded borders.
-
getBackgroundColor
public java.lang.String getBackgroundColor()
Note: displaying rounded corners is not supported by LibreOffice.- Returns:
- Background color of the entire chart.
-
setBackgroundColor
public void setBackgroundColor(java.lang.String backgroundColor)
Note: displaying rounded corners is not supported by LibreOffice.- Parameters:
backgroundColor
- Background color of the entire chart.
-
getBackgroundOpacity
public java.lang.Integer getBackgroundOpacity()
Note: backgroundOpacity is ignored if backgroundColor is not specified or if backgroundColor is specified in a color space which includes an alpha channel (e.g. rgba(0,191,255,0.5)). In the latter case, the alpha channel in backgroundColor is used.- Returns:
- The opacity of the entire chart.
-
setBackgroundOpacity
public void setBackgroundOpacity(java.lang.Integer backgroundOpacity)
Note: backgroundOpacity is ignored if backgroundColor is not specified or if backgroundColor is specified in a color space which includes an alpha channel (e.g. rgba(0,191,255,0.5)). In the latter case, the alpha channel in backgroundColor is used.- Parameters:
backgroundOpacity
- The opacity of the entire chart.
-
getTitle
public java.lang.String getTitle()
- Returns:
- Title of the chart.
-
setTitle
public void setTitle(java.lang.String title)
- Parameters:
title
- Title of the chart.
-
getTitleStyle
public ChartTextStyle getTitleStyle()
- Returns:
- Style of the title of the chart.
-
setTitleStyle
public void setTitleStyle(ChartTextStyle titleStyle)
- Parameters:
titleStyle
- Style of the title of the chart.
-
getShowLegend
public java.lang.Boolean getShowLegend()
- Returns:
- Whether the legend should be shown.
-
getLegendPosition
public java.lang.String getLegendPosition()
- Returns:
- Position of the legend. 'l' for left, 'r' right, 'b' bottom, 't' top
-
getLegendStyle
public ChartTextStyle getLegendStyle()
- Returns:
- Style for the legend text.
-
setLegend
public void setLegend(java.lang.String position, ChartTextStyle style)
Turns the legend on. Use null for the parameters if you don't want to specify them.- Parameters:
position
- Position of the legend. 'l' for left, 'r' right, 'b' bottom, 't' topstyle
- Style for the legend text.
-
removeLegend
public void removeLegend()
Turns the legend of.
-
getShowDataLabels
public java.lang.Boolean getShowDataLabels()
Default true for pie/pie3d and doughnut.- Returns:
- Whether to show data labels on the chart.
-
getSeparator
public java.lang.String getSeparator()
- Returns:
- Seperator : can be either false or anything else for example \n or \t or ; or (, if false).
-
getShowSeriesName
public java.lang.Boolean getShowSeriesName()
- Returns:
- Whether to include the series name in the data label.
-
getShowCategoryName
public java.lang.Boolean getShowCategoryName()
- Returns:
- Whether to include the series category name in the data label.
-
getShowLegendKey
public java.lang.Boolean getShowLegendKey()
- Returns:
- Whether to include the legend key (i.e the color of the series) in the data label.
-
getShowValue
public java.lang.Boolean getShowValue()
- Returns:
- Whether to include the actual value in the data label.
-
getShowPercentage
public java.lang.Boolean getShowPercentage()
- Returns:
- Whether to include the percentage, default true for pie/pie3d and doughnut.
-
getPosition
public java.lang.String getPosition()
Note that not all options might be available for specific charts.- Returns:
- Position of the data label , can be 'center', 'left', 'right', 'above', 'below', 'insideBase', 'bestFit', 'outsideEnd', 'insideEnd'.
-
setDataLabels
public void setDataLabels(java.lang.String separator, java.lang.Boolean showSeriesName, java.lang.Boolean showCategoryName, java.lang.Boolean showLegendKey, java.lang.Boolean showValue, java.lang.Boolean showPercentage, java.lang.String position)
Turn the data labels on. If you don't want to specify an option use null as argument.- Parameters:
separator
- Seperator : can be either false or anything else for example \n or \t or ; or (, if false).showSeriesName
- Whether to include the series name in the data label.showCategoryName
- Whether to include the series category name in the data label.showLegendKey
- Whether to include the legend key (i.e the color of the series) in the data label.showValue
- Whether to include the actual value in the data label.showPercentage
- Whether to include the percentage, default true for pie/pie3d and doughnut.position
- Position of the data label , can be 'center', 'left', 'right', 'above', 'below', 'insideBase', 'bestFit', 'outsideEnd', 'insideEnd'. Note that not all options might be available for specific charts.
-
removeDataLabels
public void removeDataLabels()
Turns the datalabels of.
-
getGrid
public java.lang.Boolean getGrid()
- Returns:
- Whether the chart should have a grid or not.
-
setGrid
public void setGrid(java.lang.Boolean grid)
- Parameters:
grid
- Whether the chart should have a grid or not.
-
getJSON
public com.google.gson.JsonObject getJSON()
- Returns:
- JSONObject with the tags for this element for the Cloud Office Print server.
-
-