Package com.day.cq.wcm.foundation
Class Chart
java.lang.Object
com.day.cq.wcm.foundation.Chart
Provides convenience methods for displaying charts.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringvalue of the bar chart typestatic final ColorDefault data colorstatic final Stringvalue of the line chart typestatic final Stringvalue of the pie chart typestatic final Stringname of the alt name propertystatic final Stringname of the bar spacing property for bar chartsstatic final Stringname of the bar width property for bar chartsstatic final Stringname of the background color propertystatic final Stringname of the chart type propertystatic final Stringname of the data propertystatic final Stringname of the data color propertystatic final Stringname of the width propertystatic final Stringname of the label color propertystatic final Stringname of the line width property for line chartsstatic final Stringname of the line color propertystatic final Stringname of the start angle property for pie chartsstatic final Stringname of the title propertystatic final Stringname of the width property -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a property either from the overlaid map or the underlying properties.getAlt()Returns the chart alt name as defined by "chartAlt"Returns the chart layer of this chart.Get a color either from the overlaid map or the underlying properties.Get a double property either from the overlaid map or the underlying properties.Get a float property either from the overlaid map or the underlying properties.Get a integer property either from the overlaid map or the underlying properties.Returns the legend layer of this chart.Get a string property either from the overlaid map or the underlying properties.booleanhasData()Checks if this chart has contentvoidloadStyleData(Style style) Loads several definitions from style.
-
Field Details
-
PIE_CHART_TYPE
value of the pie chart type- See Also:
-
BAR_CHART_TYPE
value of the bar chart type- See Also:
-
LINE_CHART_TYPE
value of the line chart type- See Also:
-
PN_TITLE
name of the title property- See Also:
-
PN_CHART_TYPE
name of the chart type property- See Also:
-
PN_ALT
name of the alt name property- See Also:
-
PN_DATA
name of the data property- See Also:
-
PN_WIDTH
name of the width property- See Also:
-
PN_HEIGHT
name of the width property- See Also:
-
PN_PC_START_ANGLE
name of the start angle property for pie charts- See Also:
-
PN_LC_LINE_WIDTH
name of the line width property for line charts- See Also:
-
PN_BC_BAR_WIDTH
name of the bar width property for bar charts- See Also:
-
PN_BC_BAR_SPACING
name of the bar spacing property for bar charts- See Also:
-
PN_BG_COLOR
name of the background color property- See Also:
-
PN_LABEL_COLOR
name of the label color property- See Also:
-
PN_LINE_COLOR
name of the line color property- See Also:
-
PN_DATA_COLORS
name of the data color property- See Also:
-
DEFAULT_DATA_COLOR
Default data color
-
-
Constructor Details
-
Chart
Creates a new chart based on the given resource.- Parameters:
resource- resource of the chart- Throws:
IllegalArgumentException- if the given resource is not adaptable to node.
-
-
Method Details
-
hasData
public boolean hasData()Checks if this chart has content- Returns:
trueif this chart has content
-
getAlt
Returns the chart alt name as defined by "chartAlt"- Returns:
- the alt name
- See Also:
-
get
Get a property either from the overlaid map or the underlying properties.- Parameters:
name- name of the property- Returns:
- value of the property or null
-
getString
Get a string property either from the overlaid map or the underlying properties.- Parameters:
name- name of the property- Returns:
- string value of the property or null
-
getInt
Get a integer property either from the overlaid map or the underlying properties.- Parameters:
name- name of the property- Returns:
- integer value of the property or null
-
getDouble
Get a double property either from the overlaid map or the underlying properties.- Parameters:
name- name of the property- Returns:
- double value of the property or null
-
getFloat
Get a float property either from the overlaid map or the underlying properties.- Parameters:
name- name of the property- Returns:
- double value of the property or null
-
getColor
Get a color either from the overlaid map or the underlying properties.- Parameters:
name- name of the property- Returns:
- Color color of the property or null
-
loadStyleData
Loads several definitions from style.- Parameters:
style- style to load definitions from
-
getChartLayer
Returns the chart layer of this chart.- Returns:
- the layer
- Throws:
IOException- if an I/O error occurs.RepositoryException- if a repository error occurs.
-
getLegendLayer
Returns the legend layer of this chart.- Returns:
- the layer
- Throws:
IOException- if an I/O error occurs.RepositoryException- if a repository error occurs.
-