Class COPChart
- java.lang.Object
-
- com.cloudofficeprint.RenderElements.RenderElement
-
- com.cloudofficeprint.RenderElements.COPChart
-
public class COPChart extends RenderElement
Supported in Word, Excel and Powerpoint templates. This class represent Cloud Office Print charts (including the data and style). The chart in the template can be styled through MS Office or LibreOffice as an alternative to passing the style options as a part of the input data. This allows the use of style options we do not support, but moves the chart styling from the data to the template. This may case some difficulties, e.g. : loops containing a chart with different style on each iteration would not be possible using this tag.
-
-
Constructor Summary
Constructors Constructor Description COPChart(java.lang.String name, com.google.gson.JsonArray xData, java.util.HashMap<java.lang.String,com.google.gson.JsonArray> yData, java.lang.String title, java.lang.String xTitle, java.lang.String yTitle, java.lang.String y2Title, java.lang.String x2Title, COPChartDateOptions copChartDateOptions)
Represent a Cloud Office Print chart (including data and style).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description COPChartDateOptions
getCopChartDateOptions()
com.google.gson.JsonObject
getJSON()
java.util.Set<java.lang.String>
getTemplateTags()
java.lang.String
getTitle()
java.lang.String
getX2Title()
com.google.gson.JsonArray
getXData()
java.lang.String
getXTitle()
java.lang.String
getY2Title()
java.util.HashMap<java.lang.String,com.google.gson.JsonArray>
getYData()
java.lang.String
getYTitle()
void
setCopChartDateOptions(COPChartDateOptions copChartDateOptions)
void
setTitle(java.lang.String title)
void
setX2Title(java.lang.String x2Title)
void
setXData(com.google.gson.JsonArray xData)
void
setXTitle(java.lang.String xTitle)
void
setY2Title(java.lang.String y2Title)
void
setYData(java.util.HashMap<java.lang.String,com.google.gson.JsonArray> yData)
void
setYTitle(java.lang.String yTitle)
-
Methods inherited from class com.cloudofficeprint.RenderElements.RenderElement
getName, getValue, setName, setValue
-
-
-
-
Constructor Detail
-
COPChart
public COPChart(java.lang.String name, com.google.gson.JsonArray xData, java.util.HashMap<java.lang.String,com.google.gson.JsonArray> yData, java.lang.String title, java.lang.String xTitle, java.lang.String yTitle, java.lang.String y2Title, java.lang.String x2Title, COPChartDateOptions copChartDateOptions)
Represent a Cloud Office Print chart (including data and style). If you don't want te specify some parameters, use null as argument.- Parameters:
name
- Name of the chart for the tag.xData
- ArrayList(String) of the data of the x-axis. Format : ["day 1", "day 2", "day 3", "day 4", "day 5"] or [{"value": "day 1"}, {"value": "day 2"}, {"value": "day 3"}, {"value": "day 4"}, {"value": "day 5"}]yData
- HashMap(Name of the serie), ArrayList(y-data) data in the same format as xData.title
- Title of the chart.xTitle
- Title of the x-axis.yTitle
- Title of the y-axis.y2Title
- Title of the second x-axis.x2Title
- Title of the second y-axis.copChartDateOptions
- Date options for the chart.
-
-
Method Detail
-
getXData
public com.google.gson.JsonArray getXData()
- Returns:
- JsonArray of the data of the x-axis. Format : ["day 1", "day 2", "day 3", "day 4", "day 5"] or [{"value": "day 1"}, {"value": "day 2"}, {"value": "day 3"}, {"value": "day 4"}, {"value": "day 5"}]
-
setXData
public void setXData(com.google.gson.JsonArray xData)
- Parameters:
xData
- JsonArray of the data of the x-axis. Format : ["day 1", "day 2", "day 3", "day 4", "day 5"] or [{"value": "day 1"}, {"value": "day 2"}, {"value": "day 3"}, {"value": "day 4"}, {"value": "day 5"}]
-
getYData
public java.util.HashMap<java.lang.String,com.google.gson.JsonArray> getYData()
- Returns:
- HashMap(Name of the serie, JsonArray of y-data) in the same format as xData.
-
setYData
public void setYData(java.util.HashMap<java.lang.String,com.google.gson.JsonArray> yData)
- Parameters:
yData
- HashMap(Name of the serie, JsonArray of y-data) in the same format as xData.
-
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.
-
getXTitle
public java.lang.String getXTitle()
- Returns:
- Title of the x-axis.
-
setXTitle
public void setXTitle(java.lang.String xTitle)
- Parameters:
xTitle
- Title of the x-axis.
-
getYTitle
public java.lang.String getYTitle()
- Returns:
- Title of the y-axis.
-
setYTitle
public void setYTitle(java.lang.String yTitle)
- Parameters:
yTitle
- Title of the y-axis.
-
getY2Title
public java.lang.String getY2Title()
- Returns:
- Title of the second y-axis.
-
setY2Title
public void setY2Title(java.lang.String y2Title)
- Parameters:
y2Title
- Title of the second y-axis.
-
getX2Title
public java.lang.String getX2Title()
- Returns:
- Title of the second x-axis.
-
setX2Title
public void setX2Title(java.lang.String x2Title)
- Parameters:
x2Title
- Title of the second x-axis.
-
getCopChartDateOptions
public COPChartDateOptions getCopChartDateOptions()
- Returns:
- Date options for the chart.
-
setCopChartDateOptions
public void setCopChartDateOptions(COPChartDateOptions copChartDateOptions)
- Parameters:
copChartDateOptions
- Date options for the chart.
-
getJSON
public com.google.gson.JsonObject getJSON()
- Specified by:
getJSON
in classRenderElement
- Returns:
- JSONObject with the tags for this element for the Cloud Office Print server.
-
getTemplateTags
public java.util.Set<java.lang.String> getTemplateTags()
- Specified by:
getTemplateTags
in classRenderElement
- Returns:
- An immutable set containing all available template tags this element can replace.
-
-