Class Chart

java.lang.Object
com.day.cq.wcm.foundation.Chart

public class Chart extends Object
Provides convenience methods for displaying charts.
  • Field Details

  • Constructor Details

    • Chart

      public Chart(Resource resource)
      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:
      true if this chart has content
    • getAlt

      public String getAlt()
      Returns the chart alt name as defined by "chartAlt"
      Returns:
      the alt name
      See Also:
    • get

      public Object get(String name)
      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

      public String getString(String name)
      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

      public Integer getInt(String name)
      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

      public Double getDouble(String name)
      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

      public Float getFloat(String name)
      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

      public Color getColor(String name)
      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

      public void loadStyleData(Style style)
      Loads several definitions from style.
      Parameters:
      style - style to load definitions from
    • getChartLayer

      public Layer getChartLayer() throws IOException, RepositoryException
      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

      public Layer getLegendLayer() throws IOException, RepositoryException
      Returns the legend layer of this chart.
      Returns:
      the layer
      Throws:
      IOException - if an I/O error occurs.
      RepositoryException - if a repository error occurs.