com.ibm.tivoli.maximo.skd.control.chart

Class Chart

  • java.lang.Object
    • java.util.AbstractMap
      • java.util.HashMap
        • com.ibm.json.java.JSONObject
          • com.ibm.tivoli.maximo.skd.control.chart.Chart
  • All Implemented Interfaces:
    com.ibm.json.java.JSONArtifact, java.io.Serializable, java.lang.Cloneable, java.util.Map


    public class Chart
    extends com.ibm.json.java.JSONObject
    A Chart models a Simple Chart containing one or more Series. This class extends a JSONObject for easy serialization, so that Chart information can be passed the web ui and consumed by Dojo Charts.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static interface  Chart.Fields
      Field contants in this object, or child node objects
      static interface  Chart.Positions
      Position Constants used by the Title
      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry, java.util.AbstractMap.SimpleImmutableEntry
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry
    • Constructor Summary

      Constructors 
      Constructor and Description
      Chart() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      Axis addAxis(Axis axis) 
      void addSeries(Series s)
      Add a Series to this chart.
      Axis getAxis(java.lang.String id) 
      protected com.ibm.json.java.JSONObject getAxisNode() 
      ChartType getChartType()
      Returns the ChartType (ie, Dojo Chart Type) fort his chart.
      Legend getLegend() 
      com.ibm.json.java.JSONObject getOptionsNode()
      Returns the JSON Options Node from this chart, if the options node is empty, then an Options node will be created with default values, including an empty title text.
      com.ibm.json.java.JSONArray getSeriesArray()
      Returns the Array of Series objects for this Chart.
      java.lang.String getTitle()
      Convenience Method for getting the Title from the Title node.
      Axis getXAxis() 
      com.ibm.json.java.JSONArray getXLabels()
      The X Labels for this dataset.
      Axis getYAxis() 
      com.ibm.json.java.JSONArray getYLabels()
      The X Labels for this dataset.
      boolean isNormalized()
      Returns true if the Chart is normalized
      Chart normalize()
      A Chart Needs to be normalized before we can serialize it.
      protected void normalizeSeriesSequence()
      For Columns, the X data in the Series needs to be sequential, starting at 1.
      protected void normalizeSeriesSizes()
      Ensures that each series has the same number of data elements, and in the same relative order.
      void setChartType(ChartType type)
      Sets the chart type node
      void setNormalized(boolean normalized)
      Updates the normalized flag.
      void setTitle(java.lang.String title)
      Convenience method for setting the Title in the Title node.
      void visit(ISeriesVisitor visitor)
      Allow each item in each of the series to be visited by this visitor
      • Methods inherited from class com.ibm.json.java.JSONObject

        isValidObject, isValidType, parse, parse, parse, put, serialize, serialize, serialize, serialize, serialize, serialize, toString
      • Methods inherited from class java.util.HashMap

        clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        equals, hashCode
    • Constructor Detail

      • Chart

        public Chart()
    • Method Detail

      • getOptionsNode

        public com.ibm.json.java.JSONObject getOptionsNode()
        Returns the JSON Options Node from this chart, if the options node is empty, then an Options node will be created with default values, including an empty title text. The Options node is passed into the Constructor of the Dojo Chart
      • setTitle

        public void setTitle(java.lang.String title)
        Convenience method for setting the Title in the Title node.
        Parameters:
        title -
      • getTitle

        public java.lang.String getTitle()
        Convenience Method for getting the Title from the Title node.
        Returns:
      • getChartType

        public ChartType getChartType()
        Returns the ChartType (ie, Dojo Chart Type) fort his chart. If a ChartType is not created, then a default chart type is returned.
        Returns:
      • setChartType

        public void setChartType(ChartType type)
        Sets the chart type node
        Parameters:
        type -
      • normalize

        public Chart normalize()
        A Chart Needs to be normalized before we can serialize it. normalizing the chart ensures that all nodes are created, and that the dataset data is also normalized. Many charts, such as Column or ClusteredColumns require that the series data be ordered. This method ensures that this happens.
        Returns:
      • getSeriesArray

        public com.ibm.json.java.JSONArray getSeriesArray()
        Returns the Array of Series objects for this Chart. A chart can have one or series of data.
        Returns:
      • addSeries

        public void addSeries(Series s)
        Add a Series to this chart. A Chart needs at least 1 series. A series is the data x,y values that are to be plotted by the Chart.
        Parameters:
        s -
      • normalizeSeriesSequence

        protected void normalizeSeriesSequence()
        For Columns, the X data in the Series needs to be sequential, starting at 1. normalizing the sequence readjusts the X data value, and puts the original X value in the X_REAL_VALUE field.
      • normalizeSeriesSizes

        protected void normalizeSeriesSizes()
        Ensures that each series has the same number of data elements, and in the same relative order. This is required for ClusteredColumns types of charts, since they need to cluster the series around the same X values.
      • isNormalized

        public boolean isNormalized()
        Returns true if the Chart is normalized
        Returns:
      • setNormalized

        public void setNormalized(boolean normalized)
        Updates the normalized flag.
        Parameters:
        normalized -
      • getXLabels

        public com.ibm.json.java.JSONArray getXLabels()
        The X Labels for this dataset. This should be called AFTER the dataset is normalized.
        Returns:
      • getYLabels

        public com.ibm.json.java.JSONArray getYLabels()
        The X Labels for this dataset. This should be called AFTER the dataset is normalized.
        Returns:
      • getAxisNode

        protected com.ibm.json.java.JSONObject getAxisNode()
      • addAxis

        public Axis addAxis(Axis axis)
      • getAxis

        public Axis getAxis(java.lang.String id)
      • getXAxis

        public Axis getXAxis()
      • getYAxis

        public Axis getYAxis()
      • getLegend

        public Legend getLegend()
      • visit

        public void visit(ISeriesVisitor visitor)
        Allow each item in each of the series to be visited by this visitor
        Parameters:
        visitor -