OBEROn SDK

com.oberon.ooql.sdk
Class GraphValues

java.lang.Object
  extended by com.oberon.ooql.sdk.GraphValues

public class GraphValues
extends java.lang.Object

Manages the chart values

Version:
5.0

Nested Class Summary
 class GraphValues.DataLabel
          Defines a label for chart label axis or for a pie slice
 
Constructor Summary
GraphValues()
           
GraphValues(org.jdom.Element values)
           
GraphValues(GraphStyler graphStyler)
          Generates random chart values for preview
GraphValues(java.lang.String xmlValues)
           
 
Method Summary
 void addDataLabel(GraphValues.DataLabel label)
          Add a label to the label array
 void addPieLabels(GraphValues.DataLabel[] labels)
          Add labels for a new pie
 void addPieValues(double[] values)
          Add values for a new pie
 void addSeriesValues(double[] values)
          Add values for a new series
 void fromXML(org.jdom.Element values)
          Loads the chart values from XML element tree
 void fromXMLData(java.lang.String xmlValues)
          Loads the chart values from XML string
 int getDataCount()
          Return the maximum number of values among all series.
 int getDataCount(int pieNdx)
          Get the number of values for a given pie
 GraphValues.DataLabel getDataLabel(int labelNdx)
          Get a label by its label array index
 java.util.Vector<GraphValues.DataLabel> getDataLabels()
          Return the label array
 double[] getLabelValues(int labelNdx)
          Get all series values for a specific label
 double getMaxSumValue()
          Return the maximum summarized value.
 double getMaxValue()
          Return the absolute maximum among all series values
 double getMinValue()
          Return the absolute minimum among all series values
 int getPieCount()
          Get the number of pies
 GraphValues.DataLabel getPieLabel(int pieNdx, int labelNdx)
          Get a pie label.
 GraphValues.DataLabel[] getPieLabels(int pieNdx)
          Get the pie labels
 double[] getPieValues(int pieNdx)
          Get pie values
 int getSeriesCount()
          Return the number of series
 double[] getSeriesValues(int seriesNdx)
          Get the series value array
 java.util.Vector<double[]> getValues()
          Get all series data
 java.lang.String getXMLData()
          Return the chart values XML representation
 void removeDataLabel(int labelNdx)
          Remove a label from the label array
 void removePieValues(int pieNdx)
          Remove a pie
 void removeSeriesValues(int seriesNdx)
          Remove a series
 void setSeriesValue(int seriesNdx, int labelNdx, double value)
          Set a series value
 org.jdom.Element toXML()
          Return the chart values as XML element tree
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphValues

public GraphValues()

GraphValues

public GraphValues(java.lang.String xmlValues)
Parameters:
xmlValues - a String containing the chart values in XML format

GraphValues

public GraphValues(org.jdom.Element values)
Parameters:
values - a XML element tree representing the chart values

GraphValues

public GraphValues(GraphStyler graphStyler)
Generates random chart values for preview

Parameters:
graphStyler - represents the graph features
Method Detail

addSeriesValues

public void addSeriesValues(double[] values)
Add values for a new series

Parameters:
values - an array containing the values

setSeriesValue

public void setSeriesValue(int seriesNdx,
                           int labelNdx,
                           double value)
Set a series value

Parameters:
seriesNdx - the series index (>=1)
labelNdx - the label index (index for the value array)
value - the value to set

removeSeriesValues

public void removeSeriesValues(int seriesNdx)
Remove a series

Parameters:
seriesNdx - the series index (>=1)

getSeriesValues

public double[] getSeriesValues(int seriesNdx)
Get the series value array

Parameters:
seriesNdx - the series index (>=1)

getValues

public java.util.Vector<double[]> getValues()
Get all series data

Returns:
a vector of series value array

getLabelValues

public double[] getLabelValues(int labelNdx)
Get all series values for a specific label

Parameters:
labelNdx - the label index
Returns:
an array containing series values for the same label

getSeriesCount

public int getSeriesCount()
Return the number of series


getDataCount

public int getDataCount()
Return the maximum number of values among all series.


getMinValue

public double getMinValue()
Return the absolute minimum among all series values


getMaxValue

public double getMaxValue()
Return the absolute maximum among all series values


getMaxSumValue

public double getMaxSumValue()
Return the maximum summarized value. In other words for each label is computed the corresponding series values sum and taken the maximum among them.


addDataLabel

public void addDataLabel(GraphValues.DataLabel label)
Add a label to the label array


removeDataLabel

public void removeDataLabel(int labelNdx)
Remove a label from the label array

Parameters:
labelNdx - the label index

getDataLabel

public GraphValues.DataLabel getDataLabel(int labelNdx)
Get a label by its label array index

Parameters:
labelNdx - the label index If the label is not defined returns "Item<labelNdx+1>"

getDataLabels

public java.util.Vector<GraphValues.DataLabel> getDataLabels()
Return the label array

Returns:
a vector of GraphValues.DataLabels

addPieValues

public void addPieValues(double[] values)
Add values for a new pie

Parameters:
values - an array containing the values

removePieValues

public void removePieValues(int pieNdx)
Remove a pie

Parameters:
pieNdx - the pie index

getPieValues

public double[] getPieValues(int pieNdx)
Get pie values

Parameters:
pieNdx - the pie index

getPieCount

public int getPieCount()
Get the number of pies


getDataCount

public int getDataCount(int pieNdx)
Get the number of values for a given pie

Parameters:
pieNdx - the pie index

addPieLabels

public void addPieLabels(GraphValues.DataLabel[] labels)
Add labels for a new pie

Parameters:
labels - an array containing the labels

getPieLabels

public GraphValues.DataLabel[] getPieLabels(int pieNdx)
Get the pie labels

Parameters:
pieNdx - the pie index

getPieLabel

public GraphValues.DataLabel getPieLabel(int pieNdx,
                                         int labelNdx)
Get a pie label.

Parameters:
pieNdx - the pie index
labelNdx - the label index If label is not defined returns "Pie<pieNdx>-Item<labelNdx+1>"

getXMLData

public java.lang.String getXMLData()
Return the chart values XML representation


toXML

public org.jdom.Element toXML()
Return the chart values as XML element tree


fromXMLData

public void fromXMLData(java.lang.String xmlValues)
Loads the chart values from XML string


fromXML

public void fromXML(org.jdom.Element values)
Loads the chart values from XML element tree


OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.