com.googlecode.charts4j
Class Plots

java.lang.Object
  extended by com.googlecode.charts4j.Plots

public final class Plots
extends Object

Static factory class for Plot hierarchy. The plots can then be rendered by a GChart.

Author:
Julien Chastang (julien.c.chastang at gmail dot com)
See Also:
GChart, GCharts, Data, DataUtil

Method Summary
static BarChartPlot newBarChartPlot(Data data)
          Define a bar chart plot.
static BarChartPlot newBarChartPlot(Data data, Color color)
          Define a bar chart plot.
static BarChartPlot newBarChartPlot(Data data, Color color, String legend)
          Define a bar chart series.
static Line newLine(Data data)
          Define a line.
static Line newLine(Data data, Color color)
          Define a line.
static Line newLine(Data data, Color color, String legend)
          Define a line.
static Plot newPlot(Data data)
          Define a plot.
static Plot newPlot(Data data, Color color)
          Define a plot.
static Plot newPlot(Data data, Color color, String legend)
          Define a plot.
static RadarPlot newRadarPlot(Data data)
          Define a radar plot.
static RadarPlot newRadarPlot(Data data, Color color)
          Define a radar plot.
static RadarPlot newRadarPlot(Data data, Color color, String legend)
          Define a radar plot.
static ScatterPlotData newScatterPlotData(Data xData, Data yData)
          Create the scatter plot data.
static ScatterPlotData newScatterPlotData(Data xData, Data yData, Data pointSizes)
          Create the scatter plot data.
static XYLine newXYLine(Data xData, Data yData)
          Define a xy line.
static XYLine newXYLine(Data xData, Data yData, Color color)
          Define a xy line.
static XYLine newXYLine(Data xData, Data yData, Color color, String legend)
          Define a xy line.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newBarChartPlot

public static BarChartPlot newBarChartPlot(Data data)
Define a bar chart plot. This data will be rendered by a BarChart.

Parameters:
data - Data for this bar chart plot. Cannot be null.
Returns:
a bar chart plot
See Also:
Data, DataUtil

newBarChartPlot

public static BarChartPlot newBarChartPlot(Data data,
                                           Color color)
Define a bar chart plot. This data will be rendered by a BarChart.

Parameters:
data - Data for this bar chart plot. Cannot be null.
color - Color for this bar chart plot. Cannot be null.
Returns:
a bar chart plot
See Also:
Data, DataUtil

newBarChartPlot

public static BarChartPlot newBarChartPlot(Data data,
                                           Color color,
                                           String legend)
Define a bar chart series. This data will be rendered by BarChart.

Parameters:
data - Data for this bar chart plot. Cannot be null.
color - Color for this bar chart plot. Cannot be null.
legend - Legend for this bar chart plot. Cannot be null.
Returns:
a bar chart plot
See Also:
Data, DataUtil

newScatterPlotData

public static ScatterPlotData newScatterPlotData(Data xData,
                                                 Data yData)
Create the scatter plot data.

Parameters:
xData - x data. Cannot be null.
yData - y data. Cannot be null.
Returns:
a scatter plot plot
See Also:
Data

newScatterPlotData

public static ScatterPlotData newScatterPlotData(Data xData,
                                                 Data yData,
                                                 Data pointSizes)
Create the scatter plot data. For the 3rd argument, specify the size of the data points. The data in this argument defines the sizes of each point specified in the x,y data (first and second argument). For the points to be properly rendered according to desired sizes, the developer must also specify shape marker(s) for each point via the Plot.addShapeMarkers(Shape, Color, int) method.

The size at which the data point is rendered is a function the marker size defined via the Plot.addShapeMarkers(Shape, Color, int) method, and the values passed into this method in the pointSizes object. For instance, if a point is defined (via the shape marker) with a size of 20, then the element that corresponds to that point in the data series will render proportionally to that marker definition. A value of 0 will render at size 0, a value of 100 will render at size 20.

Parameters:
xData - x data. Cannot be null.
yData - y data. Cannot be null.
pointSizes - size of x,y data. Cannot be null.
Returns:
a scatter plot plot.
See Also:
Data

newLine

public static Line newLine(Data data)
Define a line. This data will be rendered by a LineChart.

Parameters:
data - Data for this line. Cannot be null.
Returns:
line plot
See Also:
Data, DataUtil

newLine

public static Line newLine(Data data,
                           Color color)
Define a line. This data will be rendered by a LineChart.

Parameters:
data - Data for this line. Cannot be null.
color - Line color. Cannot be null.
Returns:
line plot
See Also:
Data, DataUtil

newLine

public static Line newLine(Data data,
                           Color color,
                           String legend)
Define a line. This data will be rendered by a LineChart.

Parameters:
data - Data for this line. Cannot be null.
color - Line color. Cannot be null.
legend - Legend for this line. Cannot be null.
Returns:
line plot
See Also:
Data, DataUtil

newXYLine

public static XYLine newXYLine(Data xData,
                               Data yData)
Define a xy line. This data will be rendered by a XYLineChart.

Parameters:
xData - Data for this xy line.
yData - Data for this xy line.
Returns:
xy line plot.
See Also:
Data

newXYLine

public static XYLine newXYLine(Data xData,
                               Data yData,
                               Color color)
Define a xy line. This data will be rendered by a XYLineChart.

Parameters:
xData - Data for this xy line. Cannot be null.
yData - Data for this xy line. Cannot be null.
color - XYLine color. Cannot be null.
Returns:
xy line plot
See Also:
Data, DataUtil

newXYLine

public static XYLine newXYLine(Data xData,
                               Data yData,
                               Color color,
                               String legend)
Define a xy line. This data will be rendered by a XYLineChart.

Parameters:
xData - Data for this xy line. Cannot be null.
yData - Data for this xy line. Cannot be null.
color - XYLine color. Cannot be null.
legend - Legend for this xy line. Cannot be null.
Returns:
xy line plot
See Also:
Data, DataUtil

newRadarPlot

public static RadarPlot newRadarPlot(Data data)
Define a radar plot. This data will be rendered by a RadarPlot.

Parameters:
data - Data for this radar plot. Cannot be null.
Returns:
radar plot
See Also:
Data, DataUtil

newRadarPlot

public static RadarPlot newRadarPlot(Data data,
                                     Color color)
Define a radar plot. This data will be rendered by a RadarPlot.

Parameters:
data - Data for this radar plot. Cannot be null.
color - RadarPlot color. Cannot be null.
Returns:
Radar plot
See Also:
Data, DataUtil

newRadarPlot

public static RadarPlot newRadarPlot(Data data,
                                     Color color,
                                     String legend)
Define a radar plot. This data will be rendered by a RadarPlot.

Parameters:
data - Data for this radar plot. Cannot be null.
color - RadarPlot color. Cannot be null.
legend - Legend for this radar plot. Cannot be null.
Returns:
Radar plot.
See Also:
Data, DataUtil

newPlot

public static Plot newPlot(Data data)
Define a plot. This data will be rendered by a LineChart XYLineChart BarChart RadarPlot.

Parameters:
data - Data for this plot. Cannot be null.
Returns:
plot
See Also:
Data, DataUtil

newPlot

public static Plot newPlot(Data data,
                           Color color)
Define a plot. This data will be rendered by a LineChart XYLineChart BarChart RadarPlot.

Parameters:
data - Data for this plot. Cannot be null.
color - Plot color. Cannot be null.
Returns:
plot
See Also:
Data, DataUtil

newPlot

public static Plot newPlot(Data data,
                           Color color,
                           String legend)
Define a plot. This data will be rendered by a LineChart XYLineChart BarChart RadarPlot.

Parameters:
data - Data for this plot. Cannot be null.
color - Plot color. Cannot be null.
legend - Legend for this plot. Cannot be null.
Returns:
plot
See Also:
Data, DataUtil