Package com.jalios.jcms.chart
Class ChartUtil
- java.lang.Object
-
- com.jalios.jcms.chart.ChartUtil
-
public class ChartUtil extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RatioSeries
createRatioSeries(java.util.Map<java.lang.String,java.lang.Integer> inputMap, java.util.function.Function<java.lang.String,java.lang.String> getLabel)
Create a ration series from a lambdastatic double
max(ChartSeries<?> series)
compute the max of all value of a seriesstatic double
max(TimeChartSeries series)
compute the sum of all value of a seriesstatic double
mean(ChartSeries<?> series)
compute the arithmetic mean of all value of a seriesstatic double
mean(TimeChartSeries series)
compute the arithmetic mean of all value of a seriesstatic double
min(ChartSeries<?> series)
compute the min of all value of a seriesstatic double
min(TimeChartSeries series)
compute the sum of all value of a seriesstatic void
sortRatioSeriesByValue(RatioSeries series)
Sort a ratioSeries by valuestatic double
sum(ChartSeries<?> series)
compute the sum of all value of a seriesstatic double
sum(TimeChartSeries series)
compute the sum of all value of a seriesstatic java.lang.String
writeLegend(Chart chart, java.lang.String userLang)
Create HTML legendstatic java.lang.String
writeLegend(PieChart chart, java.lang.String userLang)
Create HTML legendstatic java.lang.String
writeLegend(TimeChart chart, java.lang.String userLang)
Create HTML legend
-
-
-
Method Detail
-
sum
public static double sum(ChartSeries<?> series)
compute the sum of all value of a series- Parameters:
series
- theChartSeries
- Returns:
- the sum
-
mean
public static double mean(ChartSeries<?> series)
compute the arithmetic mean of all value of a series- Parameters:
series
- theChartSeries
- Returns:
- the mean
-
max
public static double max(ChartSeries<?> series)
compute the max of all value of a series- Parameters:
series
- theChartSeries
- Returns:
- the max
-
min
public static double min(ChartSeries<?> series)
compute the min of all value of a series- Parameters:
series
- theChartSeries
- Returns:
- the min
-
sum
public static double sum(TimeChartSeries series)
compute the sum of all value of a series- Parameters:
series
- theTimeChartSeries
- Returns:
- the sum
-
mean
public static double mean(TimeChartSeries series)
compute the arithmetic mean of all value of a series- Parameters:
series
- theTimeChartSeries
- Returns:
- the mean
-
max
public static double max(TimeChartSeries series)
compute the sum of all value of a series- Parameters:
series
- theChartSeries
- Returns:
- the sum
-
min
public static double min(TimeChartSeries series)
compute the sum of all value of a series- Parameters:
series
- theChartSeries
- Returns:
- the sum
-
sortRatioSeriesByValue
public static void sortRatioSeriesByValue(RatioSeries series)
Sort a ratioSeries by value- Parameters:
series
- theRatioSeries
-
createRatioSeries
public static RatioSeries createRatioSeries(java.util.Map<java.lang.String,java.lang.Integer> inputMap, java.util.function.Function<java.lang.String,java.lang.String> getLabel)
Create a ration series from a lambda- Parameters:
inputMap
- the map with key, valuegetLabel
- the method to get label from key- Returns:
- the
RatioSeries
-
writeLegend
public static java.lang.String writeLegend(TimeChart chart, java.lang.String userLang)
Create HTML legend- Parameters:
chart
- theTimeChart
userLang
- the lang- Returns:
- the HTML legend
-
writeLegend
public static java.lang.String writeLegend(Chart chart, java.lang.String userLang)
Create HTML legend- Parameters:
chart
- theChart
userLang
- the lang- Returns:
- the HTML legend
-
-