Class ChartTagBeautifier

java.lang.Object
com.jalios.util.Beautifier
com.jalios.jtaglib.ChartTagBeautifier

public class ChartTagBeautifier extends Beautifier
Since:
jcms-5.0.0
Author:
Olivier Jaquemet
  • Constructor Details

    • ChartTagBeautifier

      public ChartTagBeautifier()
    • ChartTagBeautifier

      public ChartTagBeautifier(Beautifier beautifier)
    • ChartTagBeautifier

      public ChartTagBeautifier(Beautifier beautifier, Beautifier legendBeautifier)
  • Method Details

    • beautify

      public String beautify(String str)
      String beautifier.
      Overrides:
      beautify in class Beautifier
    • printChartElementStyle

      public void printChartElementStyle(StringBuffer sb, String legend, int value, String display)
      Called for each value in chart, allow you to add any style to this value. For example: if (value > 90) { sb.append("background-color: red;"); } else { sb.append("background-color: blue;"); }
      Parameters:
      sb - the string buffer to append to
      legend - the legend associated with this value
      value - the value printed
      display - the format of the chart (see CharTag.DISPLAY_VCHART ChartTag.DISPLAY_HCHART)
    • printChartElementClass

      public void printChartElementClass(StringBuffer sb, String legend, int value, String display)
      Called for each value in chart, allow you to add any class to this value. For example: if (value > 90) { sb.append("importantValue"); } else { sb.append("basicValue"); }
      Parameters:
      sb - the string buffer to append to
      legend - the legend associated with this value
      value - the value printed
      display - the format of the chart (see CharTag.DISPLAY_VCHART ChartTag.DISPLAY_HCHART)
    • beautifyTitle

      public String beautifyTitle(String title)
      String beautifier for the chart title.
      Parameters:
      title - string to beautify
      Returns:
      the beautified string
    • beautifyLegend

      public String beautifyLegend(String legend, Integer[] values)
      Called for each legend of the chart which has a value associated to it.
      Parameters:
      legend - the legend to beautify
      values - the value associated with this legend
      Returns:
      the beautified legend
    • beautifyLegend

      public String beautifyLegend(String legend)
      Called for each legend of the the chart with no value.
      Parameters:
      legend - the legend to beautify
      Returns:
      the beautified legend
    • setLocale

      public void setLocale(Locale locale)
      Overrides:
      setLocale in class Beautifier