org.progeeks.jfreechart
Class ChartUtils

java.lang.Object
  extended by org.progeeks.jfreechart.ChartUtils

public class ChartUtils
extends java.lang.Object

Some useful static routines. Essentially extends JFreeChart org.jfree.data.general.DatasetUtilities and org.jfree.chart.ChartUtilities.

Version:
$Revision: 1.4 $
Author:
esword

Constructor Summary
ChartUtils()
           
 
Method Summary
static org.jfree.data.general.Dataset getDatasetFromEntity(org.jfree.chart.entity.ChartEntity entity)
           
static java.util.List getSubPlots(org.jfree.chart.plot.Plot plot)
          If the plot is a combined plot, return a list of all subplots.
static int getXIndex(org.jfree.data.xy.XYDataset dataset, int seriesIndex, double xValue)
          Returns the index of the item in the dataset with the matching x-value.
static java.lang.Number getYValue(org.jfree.data.xy.XYDataset dataset, int seriesIndex, double xValue)
           
static java.lang.Number getYValue(org.jfree.data.xy.XYDataset dataset, int seriesIndex, java.lang.Number xValue)
          Given an X value (not a series index), return the corresponding Y value if it exists or null if it doesn't.
static boolean isCombinedPlot(org.jfree.chart.plot.Plot chartPlot)
           
static boolean isDataEntity(org.jfree.chart.entity.ChartEntity entity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartUtils

public ChartUtils()
Method Detail

getXIndex

public static int getXIndex(org.jfree.data.xy.XYDataset dataset,
                            int seriesIndex,
                            double xValue)
Returns the index of the item in the dataset with the matching x-value.

Parameters:
dataset -
seriesIndex -
xValue -
Returns:
The matching index or -1 if no match exists.

getYValue

public static java.lang.Number getYValue(org.jfree.data.xy.XYDataset dataset,
                                         int seriesIndex,
                                         java.lang.Number xValue)
Given an X value (not a series index), return the corresponding Y value if it exists or null if it doesn't.

Parameters:
dataset - The dataset to search through
seriesIndex - The series to access
xValue - Value that the x-item must have
Returns:
Corresponding Y value

getYValue

public static java.lang.Number getYValue(org.jfree.data.xy.XYDataset dataset,
                                         int seriesIndex,
                                         double xValue)

getDatasetFromEntity

public static org.jfree.data.general.Dataset getDatasetFromEntity(org.jfree.chart.entity.ChartEntity entity)
Parameters:
entity -

isDataEntity

public static boolean isDataEntity(org.jfree.chart.entity.ChartEntity entity)

isCombinedPlot

public static boolean isCombinedPlot(org.jfree.chart.plot.Plot chartPlot)

getSubPlots

public static java.util.List getSubPlots(org.jfree.chart.plot.Plot plot)
If the plot is a combined plot, return a list of all subplots. Otherwise, just return a list with one element - the plot itself.

Parameters:
plot -


Copyright © 2002-2003 Paul Speed. All Rights Reserved.