Package com.jalios.jtaglib
Class ChartTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
com.jalios.jtaglib.ChartTag
- All Implemented Interfaces:
Serializable,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag
public class ChartTag
extends javax.servlet.jsp.tagext.TagSupport
This tag prints a date.
- Author:
- Jean-Philippe Encausse
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChartTagBeautifierprotected intprotected intprotected intprotected String[]static String[]protected intprotected ObjectIntTreeMapprotected Stringstatic final Stringstatic final Stringstatic final Stringprotected intprotected intprotected booleanprotected Comparatorprotected Localeprotected intprotected intprotected booleanprotected booleanprotected booleanprotected booleanprotected Stringstatic final Stringstatic final Stringstatic final Stringprotected Stringprotected Stringprotected intFields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclean()protected intCount the number of elements to display depending of the element mapprotected voidGet the max value of the mapintdoEndTag()intprotected voidprintChartElement(StringBuffer sb, String legend, int value, int color, int spanLegend, boolean separator) Print one element of the Chartprotected voidprintCSS(StringBuffer sb, int items) Print the CSS Style to display correctly chart.protected voidPrint Legend 0% - 100% of the Chartprotected voidprintLegentChart(StringBuffer sb, List legendList) Print Legend Square of the chartprotected ListprintMixedChart(StringBuffer sb, ObjectIntTreeMap items) Print all items of mixed charts chartprotected ListprintNotMixedChart(StringBuffer sb, ObjectIntTreeMap items) Print all items of not mixed charts chartprotected ListprintSingleChart(StringBuffer sb, ObjectIntTreeMap items, int color) Print all items in a chartprotected voidprotected voidprintVChartLegendList(StringBuffer sb, List legendList) protected voidPrint Legend 0% - 100% of the ChartvoidsetBeautifier(ChartTagBeautifier beautifier) voidsetColor(int color) voidsetColorFirst(int colorFirst) voidsetColorRotate(int colorRotate) voidvoidsetDataMap(ObjectIntTreeMap dataMap) voidsetDisplay(String display) voidsetFixHLengthWidth(int fixHLegWidth) voidsetHeight(int height) voidsetIsPercent(boolean isPercent) voidsetLegendComparator(Comparator legendComparator) voidvoidsetMax(int max) voidsetMaxValue(int maxValue) voidsetMixedChart(boolean mixedChart) voidsetPrintChart(boolean printChart) voidsetPrintCSS(boolean printCSS) voidvoidvoidvoidsetWidth(int width) Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
-
Field Details
-
COLORS
-
DISPLAY_VCHART
- See Also:
-
DISPLAY_HCHART
- See Also:
-
DISPLAY_TABLECHART
- See Also:
-
SORT_NONE
- See Also:
-
SORT_GREATER
- See Also:
-
SORT_LOWER
- See Also:
-
printCSS
protected boolean printCSS -
printChart
protected boolean printChart -
mixedChart
protected boolean mixedChart -
isPercent
protected boolean isPercent -
display
-
color
protected int color -
colorFirst
protected int colorFirst -
colorRotate
protected int colorRotate -
colors
-
title
-
dataMap
-
height
protected int height -
width
protected int width -
maxValue
protected int maxValue -
maxValueSet
protected boolean maxValueSet -
countValue
protected int countValue -
sort
-
max
protected int max -
fixHLegWidth
protected int fixHLegWidth -
beautifier
-
lgdCmpt
-
locale
-
unit
-
-
Constructor Details
-
ChartTag
public ChartTag()
-
-
Method Details
-
setSort
-
setMax
public void setMax(int max) -
setMixedChart
public void setMixedChart(boolean mixedChart) -
setDataMap
-
setPrintChart
public void setPrintChart(boolean printChart) -
setPrintCSS
public void setPrintCSS(boolean printCSS) -
setIsPercent
public void setIsPercent(boolean isPercent) -
setColor
public void setColor(int color) -
setColors
-
setColorFirst
public void setColorFirst(int colorFirst) -
setColorRotate
public void setColorRotate(int colorRotate) -
setTitle
-
setDisplay
-
setUnit
-
setHeight
public void setHeight(int height) -
setWidth
public void setWidth(int width) -
setMaxValue
public void setMaxValue(int maxValue) -
setFixHLengthWidth
public void setFixHLengthWidth(int fixHLegWidth) -
setBeautifier
-
setLegendComparator
-
setLocale
-
clean
protected void clean() -
countItems
protected int countItems()Count the number of elements to display depending of the element map- Returns:
- an int representing the number of elements
-
countMaxValue
protected void countMaxValue()Get the max value of the map -
printCSS
Print the CSS Style to display correctly chart.- Parameters:
sb- the buffer to print intoitems- the number of chart color to display
-
printSingleChart
Print all items in a chart- Parameters:
sb- the buffer to print intoitems- a Map of Items String/int[0]- Returns:
- a List of legend
-
printNotMixedChart
Print all items of not mixed charts chart- Parameters:
sb- the buffer to print intoitems- a Map of Items String/int[0]- Returns:
- A List that contains all legends the first item should be an Integer representing the span value.
-
printMixedChart
Print all items of mixed charts chart- Parameters:
sb- the buffer to print intoitems- a Map of Items String/int[0]- Returns:
- A List that contains all legends the first item should be an Integer representing the span value.
-
printChartElement
protected void printChartElement(StringBuffer sb, String legend, int value, int color, int spanLegend, boolean separator) Print one element of the Chart- Parameters:
sb- the buffer to printlegend- the legend to displayvalue- the value to display in %color- the color setspanLegend-separator-
-
printHLegendRatio
Print Legend 0% - 100% of the Chart- Parameters:
sb- the buffer to print
-
printVLegendRatio
Print Legend 0% - 100% of the Chart- Parameters:
sb- the buffer to print
-
printLegentChart
Print Legend Square of the chart- Parameters:
sb- the buffer to print
-
printTitle
-
printVChartLegendList
-
doStartTag
public int doStartTag() throws javax.servlet.jsp.JspException- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjavax.servlet.jsp.tagext.TagSupport- Throws:
javax.servlet.jsp.JspException
-
doEndTag
public int doEndTag()- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjavax.servlet.jsp.tagext.TagSupport
-