Package reportWriter
Class ReportChart
java.lang.Object
reportWriter.ReportChart
- Author:
- mo55
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Inner class that does all of the work. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a data series to the chartgetImage()
Return a BufferedImage of the chart.javafx.scene.chart.NumberAxis
Return a link to the chart's x-axis object.javafx.scene.chart.NumberAxis
Return a link to the chart's y-axis object.void
setAxisTitles
(String xTitle, String yTitle) Set the axis titles.void
setXAxisParams
(double lower, double upper, double tick) Set the x axis parameters.void
setYAxisParams
(double lower, double upper, double tick) Set the y axis parameters.
-
Constructor Details
-
ReportChart
Main constructor. This initializes the FX Toolkit by creating a JFXPanel, so that we can then use the JFX objects later- Parameters:
title
- The title of the chart (can be null)
-
-
Method Details
-
addSeries
Add a data series to the chart- Parameters:
seriesName
- A descriptor of the series (required)xVals
- The x-values (must be the same size as yVals)yVals
- The y-values (must be the same size as xVals)
-
getImage
Return a BufferedImage of the chart.- Returns:
- an image of the chart, or null if there was a problem
-
setAxisTitles
Set the axis titles. If this method is not called, the axes will be unlabelled- Parameters:
xTitle
-yTitle
-
-
setXAxisParams
public void setXAxisParams(double lower, double upper, double tick) Set the x axis parameters. If this method is not called, the parameters will be generated automatically- Parameters:
lower
- the value of the lower bound of the axisupper
- the value of the upper bound of the axistick
- the value between each major tick mark
-
setYAxisParams
public void setYAxisParams(double lower, double upper, double tick) Set the y axis parameters. If this method is not called, the parameters will be generated automatically- Parameters:
lower
- the value of the lower bound of the axisupper
- the value of the upper bound of the axistick
- the value between each major tick mark
-
getXAxisObject
public javafx.scene.chart.NumberAxis getXAxisObject()Return a link to the chart's x-axis object. Can be used for advanced control of the x axis parameters- Returns:
- NumberAxis representing the x-axis
-
getyAxisObject
public javafx.scene.chart.NumberAxis getyAxisObject()Return a link to the chart's y-axis object. Can be used for advanced control of the y axis parameters- Returns:
- NumberAxis representing the y-axis
-