org.statcato.graph
Class GraphFactory
- java.lang.Object
-
- org.statcato.graph.GraphFactory
-
public class GraphFactory extends java.lang.ObjectFunctions for generating graphs.- Since:
- 1.0
- See Also:
org.jfree.chart
-
-
Field Summary
Fields Modifier and Type Field and Description static java.awt.Color[]COLORSstatic intREG_CUBICCubic regressionstatic intREG_EXPExponential regressionstatic intREG_FIXEDPOWFixed power regressionstatic intREG_LINLinear regressionstatic intREG_LOGLogarithmic regressionstatic intREG_NONENo regressionstatic intREG_POLYPolynomial regressionstatic intREG_POWPower regressionstatic intREG_QUADQuadratic regression
-
Constructor Summary
Constructors Constructor and Description GraphFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.util.Vector<java.lang.Double>computeRegressionCoeff(java.util.Vector<java.lang.Double> xVector, java.util.Vector<java.lang.Double> yVector, int regressionType, double regressionArg)Computes the regression coefficients for the given vectors and regression type.static JFreeChartcreateBarChart(java.lang.String title, java.lang.String xTitle, java.lang.String yTitle, DefaultCategoryDataset dataset, PlotOrientation orientation, boolean hasLegend)Creates a bar chart.static JFreeChartcreateBoxPlot(DefaultBoxAndWhiskerCategoryDataset dataset, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, boolean showLegend, boolean horizontal)Creates a box plot.static JFreeChartcreateHistogram(java.lang.String title, java.lang.String xTitle, java.lang.String yTitle, HistogramDataset dataset, boolean hasLegend, TickUnits units, double minBin, double minBinStart, boolean center, double yTicks)Creates a histogram.static JFreeChartcreateNormalQuantilePlot(java.util.ArrayList<java.lang.Double> YColumnArray, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, boolean isDataOnXAxis, boolean showRegressionLine)Creates a normal quantile plot.static JFreeChartcreateNormalQuantilePlot(java.util.Vector<java.lang.Double> YColumnVector, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, boolean isDataOnXAxis, boolean showRegressionLine)Creates a normal quantile plot.static JFreeChartcreatePieChart(java.lang.String title, DefaultPieDataset data, boolean hasLegend, boolean hasLabel)Creates a pie chart.static JFreeChartcreateResidualPlot(XYSeriesCollection seriesCollection, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, boolean showLegend, boolean showZeroHorizon, double min, double max)Creates a residual plot.static JFreeChartcreateScatterplot(XYSeriesCollection seriesCollection, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, boolean showLegend, boolean showRegression, double min, double max)Creates a scatterplot.static JFreeChartcreateScatterplot(XYSeriesCollection seriesCollection, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, boolean showLegend, int regressionType, double regressionArg, double min, double max)Creates a scatterplot.
-
-
-
Field Detail
-
REG_NONE
public static final int REG_NONE
No regression- See Also:
- Constant Field Values
-
REG_LIN
public static final int REG_LIN
Linear regression- See Also:
- Constant Field Values
-
REG_QUAD
public static final int REG_QUAD
Quadratic regression- See Also:
- Constant Field Values
-
REG_CUBIC
public static final int REG_CUBIC
Cubic regression- See Also:
- Constant Field Values
-
REG_POLY
public static final int REG_POLY
Polynomial regression- See Also:
- Constant Field Values
-
REG_LOG
public static final int REG_LOG
Logarithmic regression- See Also:
- Constant Field Values
-
REG_POW
public static final int REG_POW
Power regression- See Also:
- Constant Field Values
-
REG_FIXEDPOW
public static final int REG_FIXEDPOW
Fixed power regression- See Also:
- Constant Field Values
-
REG_EXP
public static final int REG_EXP
Exponential regression- See Also:
- Constant Field Values
-
COLORS
public static final java.awt.Color[] COLORS
-
-
Method Detail
-
createNormalQuantilePlot
public static JFreeChart createNormalQuantilePlot(java.util.Vector<java.lang.Double> YColumnVector, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, boolean isDataOnXAxis, boolean showRegressionLine)
Creates a normal quantile plot.- Parameters:
YColumnVector- vector of data valuestitle- chart titlexLabel- x axis labelyLabel- y axis labelisDataOnXAxis- whether the data is on the x axisshowRegressionLine- whether the regression line should be shown- Returns:
- JFreeChart plot object
-
createNormalQuantilePlot
public static JFreeChart createNormalQuantilePlot(java.util.ArrayList<java.lang.Double> YColumnArray, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, boolean isDataOnXAxis, boolean showRegressionLine)
Creates a normal quantile plot.- Parameters:
YColumnArray- ArrayList of data valuestitle- chart titlexLabel- x axis labelyLabel- y axis labelisDataOnXAxis- whether the data is on the x axisshowRegressionLine- whether the regression line should be shown- Returns:
- JFreeChart plot object
-
createBoxPlot
public static JFreeChart createBoxPlot(DefaultBoxAndWhiskerCategoryDataset dataset, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, boolean showLegend, boolean horizontal)
Creates a box plot.- Parameters:
dataset- DefaultBoxAndWhisterCategoryDataset objecttitle- plot titlexLabel- x-axis labelyLabel- y-axis labelshowLegend- whether the legend should be shownhorizontal- whether the plot is horizontal- Returns:
- JFreeChart plot object
-
createScatterplot
public static JFreeChart createScatterplot(XYSeriesCollection seriesCollection, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, boolean showLegend, int regressionType, double regressionArg, double min, double max)
Creates a scatterplot.- Parameters:
seriesCollection- XYSeriesCollection containing the data seriestitle- chart titlexLabel- x-axis labelyLabel- y-axis labelshowLegend- whether the legend should be shownshowRegression- whether a regression line should be shownregressionType- type of regressionregressionArg- regression argumentmin- minimum x valuemax- maximum x value- Returns:
- JFreeChart object representing a scatterplot
-
computeRegressionCoeff
public static java.util.Vector<java.lang.Double> computeRegressionCoeff(java.util.Vector<java.lang.Double> xVector, java.util.Vector<java.lang.Double> yVector, int regressionType, double regressionArg)Computes the regression coefficients for the given vectors and regression type.- Parameters:
xVector- vector of x (independent)valuesyVector- vector of y (dependent) valuesregressionType- type of regressionregressionArg- arguments for specific types of regression- Returns:
- vector of regression coefficients
-
createScatterplot
public static JFreeChart createScatterplot(XYSeriesCollection seriesCollection, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, boolean showLegend, boolean showRegression, double min, double max)
Creates a scatterplot.- Parameters:
seriesCollection- XYSeriesCollection containing the data seriestitle- chart titlexLabel- x-axis labelyLabel- y-axis labelshowLegend- whether the legend should be shownshowRegression- whether a regression line should be shownmin- minimum x valuemax- maximum x value- Returns:
-
createResidualPlot
public static JFreeChart createResidualPlot(XYSeriesCollection seriesCollection, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, boolean showLegend, boolean showZeroHorizon, double min, double max)
Creates a residual plot.- Parameters:
seriesCollection- XYSeriesCollection containing the data series Y series contains residualstitle- chart titlexLabel- x-axis labelyLabel- y-axis labelshowLegend- whether the legend should be shownshowZeroHorizon- whether a horizontal line Y = 0 should be shownmin- minimum x valuemax- maximum x value- Returns:
- JFreeChart residual plot
-
createBarChart
public static JFreeChart createBarChart(java.lang.String title, java.lang.String xTitle, java.lang.String yTitle, DefaultCategoryDataset dataset, PlotOrientation orientation, boolean hasLegend)
Creates a bar chart.- Parameters:
title- chart titlexTitle- x-axis titleyTitle- y-axis titledataset- bar chart datasetorientation- chart orientationhasLegend- whether a legend is included- Returns:
- JFreeChart object representing a bar chart
-
createPieChart
public static JFreeChart createPieChart(java.lang.String title, DefaultPieDataset data, boolean hasLegend, boolean hasLabel)
Creates a pie chart.- Parameters:
title- chart titledata- pie chart datasethasLegend- whether a legend is includedhasLabel- whether labels for pie slices are included- Returns:
- JFreeChart object representing a pie chart
-
createHistogram
public static JFreeChart createHistogram(java.lang.String title, java.lang.String xTitle, java.lang.String yTitle, HistogramDataset dataset, boolean hasLegend, TickUnits units, double minBin, double minBinStart, boolean center, double yTicks)
Creates a histogram.- Parameters:
title- title of the histogramxTitle- x-axis labelyTitle- y-axis labeldataset- HistogramDataset objecthasLegend- whether a legend should be displayedunits- tick units object of the x-axisminBin- bin sizeminBinStart- the start of the first bincenter- whether the tick marks should be displayed in the middle of binsyTicks- tick mark units of the y-axis- Returns:
- JFreeChart object representing a histogram
-
-
DMelt 3.0 © DataMelt by jWork.ORG