Package com.jalios.jtaglib
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
-
-
Field Summary
-
Fields inherited from class com.jalios.util.Beautifier
html, locale, truncate
-
-
Constructor Summary
Constructors Constructor Description ChartTagBeautifier()ChartTagBeautifier(Beautifier beautifier)ChartTagBeautifier(Beautifier beautifier, Beautifier legendBeautifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringbeautify(java.lang.String str)String beautifier.java.lang.StringbeautifyLegend(java.lang.String legend)Called for each legend of the the chart with no value.java.lang.StringbeautifyLegend(java.lang.String legend, java.lang.Integer[] values)Called for each legend of the chart which has a value associated to it.java.lang.StringbeautifyTitle(java.lang.String title)String beautifier for the chart title.voidprintChartElementClass(java.lang.StringBuffer sb, java.lang.String legend, int value, java.lang.String display)Called for each value in chart, allow you to add any class to this value.voidprintChartElementStyle(java.lang.StringBuffer sb, java.lang.String legend, int value, java.lang.String display)Called for each value in chart, allow you to add any style to this value.voidsetLocale(java.util.Locale locale)-
Methods inherited from class com.jalios.util.Beautifier
getHtml, getLocale, setHtml
-
-
-
-
Constructor Detail
-
ChartTagBeautifier
public ChartTagBeautifier()
-
ChartTagBeautifier
public ChartTagBeautifier(Beautifier beautifier)
-
ChartTagBeautifier
public ChartTagBeautifier(Beautifier beautifier, Beautifier legendBeautifier)
-
-
Method Detail
-
beautify
public java.lang.String beautify(java.lang.String str)
String beautifier.- Overrides:
beautifyin classBeautifier
-
printChartElementStyle
public void printChartElementStyle(java.lang.StringBuffer sb, java.lang.String legend, int value, java.lang.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 tolegend- the legend associated with this valuevalue- the value printeddisplay- the format of the chart (see CharTag.DISPLAY_VCHART ChartTag.DISPLAY_HCHART)
-
printChartElementClass
public void printChartElementClass(java.lang.StringBuffer sb, java.lang.String legend, int value, java.lang.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 tolegend- the legend associated with this valuevalue- the value printeddisplay- the format of the chart (see CharTag.DISPLAY_VCHART ChartTag.DISPLAY_HCHART)
-
beautifyTitle
public java.lang.String beautifyTitle(java.lang.String title)
String beautifier for the chart title.- Parameters:
title- string to beautify- Returns:
- the beautified string
-
beautifyLegend
public java.lang.String beautifyLegend(java.lang.String legend, java.lang.Integer[] values)Called for each legend of the chart which has a value associated to it.- Parameters:
legend- the legend to beautifyvalues- the value associated with this legend- Returns:
- the beautified legend
-
beautifyLegend
public java.lang.String beautifyLegend(java.lang.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(java.util.Locale locale)
- Overrides:
setLocalein classBeautifier
-
-