org.achartengine.util
Class MathHelper

java.lang.Object
  extended by org.achartengine.util.MathHelper

public class MathHelper
extends java.lang.Object

Utility class for math operations.


Field Summary
static double NULL_VALUE
          A value that is used a null value.
 
Method Summary
static java.util.List<java.lang.Double> getLabels(double start, double end, int approxNumLabels)
          Computes a reasonable set of labels for a data interval and number of labels.
static double[] minmax(java.util.List<java.lang.Double> values)
          Calculate the minimum and maximum values out of a list of doubles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_VALUE

public static final double NULL_VALUE
A value that is used a null value.

See Also:
Constant Field Values
Method Detail

minmax

public static double[] minmax(java.util.List<java.lang.Double> values)
Calculate the minimum and maximum values out of a list of doubles.

Parameters:
values - the input values
Returns:
an array with the minimum and maximum values

getLabels

public static java.util.List<java.lang.Double> getLabels(double start,
                                                         double end,
                                                         int approxNumLabels)
Computes a reasonable set of labels for a data interval and number of labels.

Parameters:
start - start value
end - final value
approxNumLabels - desired number of labels
Returns:
collection containing the label values


Copyright © 2009 - 2011 4ViewSoft. All Rights Reserved.