Class ChartUtil

java.lang.Object
com.jalios.jcms.chart.ChartUtil

public class ChartUtil extends Object
  • Method Details

    • sum

      public static double sum(ChartSeries<?> series)
      compute the sum of all value of a series
      Parameters:
      series - the ChartSeries
      Returns:
      the sum
    • mean

      public static double mean(ChartSeries<?> series)
      compute the arithmetic mean of all value of a series
      Parameters:
      series - the ChartSeries
      Returns:
      the mean
    • max

      public static double max(ChartSeries<?> series)
      compute the max of all value of a series
      Parameters:
      series - the ChartSeries
      Returns:
      the max
    • min

      public static double min(ChartSeries<?> series)
      compute the min of all value of a series
      Parameters:
      series - the ChartSeries
      Returns:
      the min
    • sum

      public static double sum(TimeChartSeries series)
      compute the sum of all value of a series
      Parameters:
      series - the TimeChartSeries
      Returns:
      the sum
    • mean

      public static double mean(TimeChartSeries series)
      compute the arithmetic mean of all value of a series
      Parameters:
      series - the TimeChartSeries
      Returns:
      the mean
    • max

      public static double max(TimeChartSeries series)
      compute the sum of all value of a series
      Parameters:
      series - the ChartSeries
      Returns:
      the sum
    • min

      public static double min(TimeChartSeries series)
      compute the sum of all value of a series
      Parameters:
      series - the ChartSeries
      Returns:
      the sum
    • sortRatioSeriesByValue

      public static void sortRatioSeriesByValue(RatioSeries series)
      Sort a ratioSeries by value
      Parameters:
      series - the RatioSeries
    • createRatioSeries

      public static RatioSeries createRatioSeries(Map<String,Integer> inputMap, Function<String,String> getLabel)
      Create a ration series from a lambda
      Parameters:
      inputMap - the map with key, value
      getLabel - the method to get label from key
      Returns:
      the RatioSeries
    • writeLegend

      public static String writeLegend(TimeChart chart, String userLang)
      Create HTML legend
      Parameters:
      chart - the TimeChart
      userLang - the lang
      Returns:
      the HTML legend
    • writeLegend

      public static String writeLegend(Chart chart, String userLang)
      Create HTML legend
      Parameters:
      chart - the Chart
      userLang - the lang
      Returns:
      the HTML legend
    • writeLegend

      public static String writeLegend(PieChart chart, String userLang)
      Create HTML legend
      Parameters:
      chart - the PieChart
      userLang - the lang
      Returns:
      the HTML legend