Class JFreeChartHelper
java.lang.Object
net.simplace.ui.jfreechart.JFreeChartHelper
Helper for JFreeChart: fuzzy membership charts and category datasets from arrays.
- Author:
- Andreas Enders
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumShape of a fuzzy membership function. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.jfree.data.category.CategoryDatasetcreateCatagoryDataset(double catOffset, double catFactor, Comparable[] dataDesc, Object[]... data) Creates aCategoryDatasetfrom an Array of numbers.static org.jfree.data.category.CategoryDatasetcreateCatagoryDataset(Comparable[] category, Comparable[] dataDesc, Object[]... data) Creates aCategoryDatasetfrom an Array of numbersstatic org.jfree.chart.ChartPanelfuzzyChart(JFreeChartHelper.FuzzyType aType, Integer aX1, Integer aX2, Integer aX3, Integer aX4, String aAxisLabelX) Creates a chart of a fuzzy membership function (0 to 1) through the given x values, extended by 20% of the x range on both sides.
-
Constructor Details
-
JFreeChartHelper
public JFreeChartHelper()
-
-
Method Details
-
fuzzyChart
public static org.jfree.chart.ChartPanel fuzzyChart(JFreeChartHelper.FuzzyType aType, Integer aX1, Integer aX2, Integer aX3, Integer aX4, String aAxisLabelX) Creates a chart of a fuzzy membership function (0 to 1) through the given x values, extended by 20% of the x range on both sides. The axis labels are localized.- Parameters:
aType- shape of the functionaX1- first junction point, requiredaX2- second junction point, requiredaX3- third junction point, required forJFreeChartHelper.FuzzyType.UP_DOWNandJFreeChartHelper.FuzzyType.DOWN_UPaX4- fourth junction point, optional forJFreeChartHelper.FuzzyType.UP_DOWNandJFreeChartHelper.FuzzyType.DOWN_UPaAxisLabelX- locale key (and default) of the x axis label- Returns:
- panel with the chart
- Throws:
IllegalArgumentException- if the type isnullIllegalStateException- if required points are missing or not in ascending order
-
createCatagoryDataset
public static org.jfree.data.category.CategoryDataset createCatagoryDataset(Comparable[] category, Comparable[] dataDesc, Object[]... data) Creates aCategoryDatasetfrom an Array of numbers- Parameters:
category- (horizontal) categories of the data (ifnullthe array indices are used)dataDesc- descriptions of the data rows (ifnullthe array indices are used)data- the series- Returns:
- the dataset
- Throws:
UnsupportedOperationException- if a value is not a number
-
createCatagoryDataset
public static org.jfree.data.category.CategoryDataset createCatagoryDataset(double catOffset, double catFactor, Comparable[] dataDesc, Object[]... data) Creates aCategoryDatasetfrom an Array of numbers. The categories are generated automatically from the array indices:category = catOffset + idx*catFactor- Parameters:
catOffset- Offset added to the data arrays indexcatFactor- Factor the data arrays index is multiplied withdataDesc- descriptions of the data rows (ifnullthe array indices are used)data- the series- Returns:
- the dataset
- Throws:
UnsupportedOperationException- if a value is not a number
-