Class CombinedChart
- java.lang.Object
-
- com.cloudofficeprint.RenderElements.RenderElement
-
- com.cloudofficeprint.RenderElements.Charts.Charts.Chart
-
- com.cloudofficeprint.RenderElements.Charts.Charts.CombinedChart
-
public class CombinedChart extends Chart
Represents a combined chart. Multiple chart types can be combined (but there can be maximum 2 y-axis).
-
-
Constructor Summary
Constructors Constructor Description CombinedChart(java.lang.String name, ChartOptions options, Chart[] charts, Chart[] secondaryCharts)
Represents a combined chart.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.ArrayList<Chart>
getCharts()
com.google.gson.JsonObject
getJSON()
com.google.gson.JsonArray
getModifiedChartDicts()
java.util.ArrayList<Chart>
getSecondaryCharts()
com.google.gson.JsonObject
replaceKeyRecursive(com.google.gson.JsonObject jsonOld, java.lang.String oldKey, java.lang.String newKey)
Replaces all the occurrences of oldKey in the json with the newKey.void
setCharts(java.util.ArrayList<Chart> charts)
void
setSecondaryCharts(java.util.ArrayList<Chart> secondaryCharts)
-
Methods inherited from class com.cloudofficeprint.RenderElements.Charts.Charts.Chart
getOptions, getTemplateTags, setOptions
-
Methods inherited from class com.cloudofficeprint.RenderElements.RenderElement
getName, getValue, setName, setValue
-
-
-
-
Constructor Detail
-
CombinedChart
public CombinedChart(java.lang.String name, ChartOptions options, Chart[] charts, Chart[] secondaryCharts)
Represents a combined chart. Multiple chart types can be combined (but there can be maximum 2 y-axis).- Parameters:
name
- Name of the chart (for the tag).options
- Options of the chart.charts
- Charts for the first y-axis.secondaryCharts
- Charts for the second y-axis.
-
-
Method Detail
-
getCharts
public java.util.ArrayList<Chart> getCharts()
- Returns:
- Charts for the first y-axis.
-
setCharts
public void setCharts(java.util.ArrayList<Chart> charts)
- Parameters:
charts
- Charts for the first y-axis.
-
getSecondaryCharts
public java.util.ArrayList<Chart> getSecondaryCharts()
- Returns:
- Charts for the second y-axis.
-
setSecondaryCharts
public void setSecondaryCharts(java.util.ArrayList<Chart> secondaryCharts)
- Parameters:
secondaryCharts
- Charts for the second y-axis.
-
replaceKeyRecursive
public com.google.gson.JsonObject replaceKeyRecursive(com.google.gson.JsonObject jsonOld, java.lang.String oldKey, java.lang.String newKey)
Replaces all the occurrences of oldKey in the json with the newKey. Objects with key "options" will not be modified (y-axis stays y-axis).- Parameters:
jsonOld
- Json to be modified.oldKey
- Old keys to be replaced.newKey
- New key to replace the old key.- Returns:
- Json with the old key replaced by the new key.
-
getModifiedChartDicts
public com.google.gson.JsonArray getModifiedChartDicts()
- Returns:
- An array of the JSONs of the charts but adapted to a multiple 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.
-
-