Class PdfJFCSerieBox

All Implemented Interfaces:
Serializable, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, Identified

@Component public class PdfJFCSerieBox extends PdfBox
This class extends PdfBox and implements the management of a box with a Serie graph inside.
See Also:
  • Field Details

    • FACTORY_PATH

      public static final String FACTORY_PATH
      See Also:
    • _img

      protected com.lowagie.text.Image _img
    • _format

      protected String _format
    • _width

      protected String _width
    • _height

      protected String _height
    • _title

      protected String _title
    • _titleFont

      protected String _titleFont
    • _vertical

      protected String _vertical
    • _ddd

      protected String _ddd
    • _shadow

      protected String _shadow
    • _rounded

      protected String _rounded
    • _labels

      protected String _labels
    • _upperMargin

      protected String _upperMargin
    • _lowerMargin

      protected String _lowerMargin
    • _barWidth

      protected String _barWidth
    • _barStacked

      protected String _barStacked
    • _areaStacked

      protected String _areaStacked
    • _domainTitle

      protected String _domainTitle
    • _domainTitleFont

      protected String _domainTitleFont
    • _domainLabels

      protected String _domainLabels
    • _domainFont

      protected String _domainFont
    • _domainRotation

      protected String _domainRotation
    • _domainMargin

      protected String _domainMargin
    • _domainMarkerColor

      protected String _domainMarkerColor
    • _domainMarkerFont

      protected String _domainMarkerFont
    • _domainMarkerLabel

      protected String _domainMarkerLabel
    • _domainMarkerPosition

      protected String _domainMarkerPosition
    • _domainGridLine

      protected String _domainGridLine
    • _valuesGridLine

      protected String _valuesGridLine
    • _valuesMin

      protected String _valuesMin
    • _valuesMax

      protected String _valuesMax
    • _valuesStep

      protected String _valuesStep
    • _valuesVertical

      protected String _valuesVertical
    • _valuesTitle

      protected String _valuesTitle
    • _valuesTitleFont

      protected String _valuesTitleFont
    • _valuesFont

      protected String _valuesFont
    • _valuesNumberFormat

      protected String _valuesNumberFormat
    • _valuesMarkerValue

      protected String _valuesMarkerValue
    • _valuesMarkerSize

      protected String _valuesMarkerSize
    • _valuesMarkerColor

      protected String _valuesMarkerColor
    • _valuesMarkerFont

      protected String _valuesMarkerFont
    • _valuesMarkerLabel

      protected String _valuesMarkerLabel
    • _valuesMarkerPosition

      protected String _valuesMarkerPosition
    • _itemLabelRotation

      protected String _itemLabelRotation
    • _itemLabelPosition

      protected String _itemLabelPosition
    • _itemLabelFont

      protected String _itemLabelFont
    • _itemBackgroundColor

      protected String _itemBackgroundColor
    • _itemInsetBackgroundColor

      protected String _itemInsetBackgroundColor
    • _itemLabelFormat

      protected String _itemLabelFormat
    • _legendFont

      protected String _legendFont
    • _legendBox

      protected String _legendBox
    • _jfcSerie

      protected JFCSerie _jfcSerie
    • _jfcStyle

      protected JFCStyle _jfcStyle
    • _series

      protected ArrayList _series
    • _barseries

      protected ArrayList _barseries
    • _areaseries

      protected ArrayList _areaseries
    • _lineseries

      protected ArrayList _lineseries
    • _serieIds

      protected HashMap<overit.geocall.charts.Serie,Integer> _serieIds
  • Constructor Details

    • PdfJFCSerieBox

      public PdfJFCSerieBox()
  • Method Details

    • setFORMAT

      public void setFORMAT(String s)
      Defines the format of the image that will be created
      Parameters:
      s - JFCRaw.PNG to create a PNG image, JFCRaw.JPEG to create a JPEG image. The default value is JFCRaw.PNG
    • setWIDTH

      public void setWIDTH(String s)
      Sets the graph width.
      Parameters:
      s - The Graph width.
    • setHEIGHT

      public void setHEIGHT(String s)
      Sets the graph height.
      Parameters:
      s - The Graph height.
    • setDDD

      public void setDDD(String s)
      Defines if the chart will have a three dimensional design or not
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default value, that is false
    • setTITLE

      public void setTITLE(String s)
      Sets the graph title
      Parameters:
      s - The Graph title.
    • setTITLEFONT

      public void setTITLEFONT(String s)
      Sets the graph title font.
      Parameters:
      s - The Graph title font.
    • getTitle

      public String getTitle()
      gets the graph title.
      Returns:
      The Graph title.
    • setDOMAINLABELS

      public void setDOMAINLABELS(String s)
      Sets the labels of the elements of the domain (x) axis for each serie
      Parameters:
      s - A list that contains the labels
    • setDOMAINFONT

      public void setDOMAINFONT(String s)
      Sets the font for the labels of the values on the domain (x) axis
      Parameters:
      s - A string that defines the font, with the format: name,variant,dimension,color. See JFCSerie.setDOMAINTITLEFONT(java.lang.String)
    • setDOMAINTITLE

      public void setDOMAINTITLE(String s)
      Sets the label for the domain (x) axis
      Parameters:
      s - The string that represents the label for the domain (x) axis
    • setDOMAINTITLEFONT

      public void setDOMAINTITLEFONT(String s)
      Sets the font for the label of the domain (x) axis
      Parameters:
      s - A string that defines the font, with the format: name,variant,dimension,color.
      The possible values for the variation of the font are: i (italic) and b (bold).
      It is possible to use both the values, like ib or bi to obtain the font both bold and italic.
      The format for the color is described in the JFCStyle class.
      You can omit some values, in which case you fall back to the default ones. The default font setting is: Tahoma,plain,12,#000000
    • setDOMAINROTATION

      public void setDOMAINROTATION(String s)
      Sets the degrees of the rotation for the labels of the values on the domain (x) axis
      Parameters:
      s - An integer value that defines the rotation
    • setDOMAINMARGIN

      public void setDOMAINMARGIN(String s)
      Sets the margin between the values on the domain (x) axis
      Parameters:
      s - A double that defines the margin between the values on the domain (x) axis
    • setBARWIDTH

      public void setBARWIDTH(String s)
      Sets the bar width of the chart
      Parameters:
      s - The width to set.
    • setBARSTACKED

      public void setBARSTACKED(String s)
      Defines, only for the bar charts, if the bars must be stacked or not
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default one, that is false
    • setAREASTACKED

      public void setAREASTACKED(String s)
      Defines, only for the area charts, if the areas must be stacked or not
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default one, that is false
    • setSHADOW

      public void setSHADOW(String s)
      Sets the graph shadow
      Parameters:
      s - The shadow to set.
    • setVERTICAL

      public void setVERTICAL(String s)
      Defines the chart orientation (vertical, that is the default value, or horizontal)
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default one, that is true
    • setROUNDED

      public void setROUNDED(String s)
      Defines if the chart will have a rounded design or not
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default value, that is false
    • setUPPERMARGIN

      public void setUPPERMARGIN(String s)
      Sets the upper margin for the value (y) axis.
      Parameters:
      s - A double value that represents the upper margin for the y axis
    • setLOWERMARGIN

      public void setLOWERMARGIN(String s)
      Sets the lower margin for the value (y) axis.
      Parameters:
      s - A double value that represents the lower margin for the y axis
    • setDOMAINGRIDLINE

      public void setDOMAINGRIDLINE(String s)
      Sets if the grid lines of the domain (x) axis will be visible (default value) or not
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default one, that is true
    • setVALUESGRIDLINE

      public void setVALUESGRIDLINE(String s)
      Sets if the grid lines of the value (y) axis will be visible or not (default value)
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default one, that is false
    • setVALUESMIN

      public void setVALUESMIN(String s)
      Sets the minimum value for the value (y) axis.
      Parameters:
      s - A double value that represents the minimum value for the y axis
    • setVALUESMAX

      public void setVALUESMAX(String s)
      Sets the maximum value for the value (y) axis.
      Parameters:
      s - A double value that represents the maximum value for the y axis
    • setVALUESSTEP

      public void setVALUESSTEP(String s)
      Sets the step between the values for the value (y) axis.
      Parameters:
      s - A double value that represents the step between the values
    • setVALUESVERTICAL

      public void setVALUESVERTICAL(String s)
      Defines if the values of the value (y) axis must have a vertical orientation or not (default)
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default one, that is false
    • setVALUESTITLE

      public void setVALUESTITLE(String s)
      Sets the label of the value (y) axis
      Parameters:
      s - A string that represents the label for the value (y) axis
    • setVALUESTITLEFONT

      public void setVALUESTITLEFONT(String s)
      Sets the font for the label of the value (y) axis
      Parameters:
      s - A string that defines the font. For the font definition see JFCSerie.setDOMAINTITLEFONT(java.lang.String)
    • setVALUESFONT

      public void setVALUESFONT(String s)
      Sets the font for the values of the value (y) axis
      Parameters:
      s - A string that defines the font. For the font definition see JFCSerie.setDOMAINTITLEFONT(java.lang.String)
    • setVALUESNUMBERFORMAT

      public void setVALUESNUMBERFORMAT(String s)
      Defines the format of the values
      Parameters:
      s - A string that represents a decimal format. The default value is ,##0.###
    • setDOMAINMARKERCOLOR

      public void setDOMAINMARKERCOLOR(String s)
      Sets the colors of the markers for elements of the domain (x) axis for each serie
      Parameters:
      s - A list taht contains the colors. The format for the colors is described in the JFCStyle class.
    • setDOMAINMARKERFONT

      public void setDOMAINMARKERFONT(String s)
      Sets the font of the markers for the elements of the domain (x) axis
      Parameters:
      s - A string that defines the font. For the font definition see JFCSerie.setDOMAINTITLEFONT(java.lang.String)
    • setDOMAINMARKERLABEL

      public void setDOMAINMARKERLABEL(String s)
      Sets the labels of the markers for the elements of the domain (x) axis for each serie
      Parameters:
      s - A list that contains the labels
    • setDOMAINMARKERPOSITION

      public void setDOMAINMARKERPOSITION(String s)
      Sets the position of the labels of the markers for the elements of the domain (x) axis
      Parameters:
      s - A string that defines the position. The possible values are: 'top' or 'bottom'
    • setVALUESMARKERVALUE

      public void setVALUESMARKERVALUE(String s)
      Sets the values of the markers for the elements of the value (y) axis for each serie
      Parameters:
      s - A list that defines the values of the markers for each serie
    • setVALUESMARKERSIZE

      public void setVALUESMARKERSIZE(String s)
      Sets the sizes of the markers for the elements of the value (y) axis for each serie.
      Parameters:
      s - A list that defines the sizes of the markers for each serie
    • setVALUESMARKERCOLOR

      public void setVALUESMARKERCOLOR(String s)
      Sets the colors of the markers for elements of the value (y) axis for each serie
      Parameters:
      s - A list that contains the colors. The format for the colors is described in the JFCStyle class.
    • setVALUESMARKERFONT

      public void setVALUESMARKERFONT(String s)
      Sets the font of the markers for the elements of the value (y) axis
      Parameters:
      s - A string that defines the font. For the font definition see JFCSerie.setDOMAINTITLEFONT(java.lang.String)
    • setVALUESMARKERLABEL

      public void setVALUESMARKERLABEL(String s)
      Sets the labels of the markers for the elements of the value (y) axis for each serie
      Parameters:
      s - A list that contains the labels
    • setVALUESMARKERPOSITION

      public void setVALUESMARKERPOSITION(String s)
      Sets the position of the labels of the markers for the elements of the value (y) axis
      Parameters:
      s - A string that defines the position. For the format of the string that defines the position see JFCSerie.setITEMLABELPOSITION(java.lang.String)
    • setITEMLABELROTATION

      public void setITEMLABELROTATION(String s)
      Sets the degrees of the rotation of the labels of the elements of the serie
      Parameters:
      s - An integer value that defines the rotation
    • setITEMLABELPOSITION

      public void setITEMLABELPOSITION(String s)
      Sets the position of the labels of the elements of the serie
      Parameters:
      s - A string that defines the position of the labels. The format that must be used is composed by two lowercase letters followed by two uppercase letters; the first ones defines the angle of rest of the element (that can be an element of the serie or a marker), the second ones the angle of rest of the label. The possible values (for both the lowercase and uppercase letters) are: (t)op, (m)iddle, (b)ottom for the height and (l)eft, (c)enter, (r)ight for the width. For example: mlTR.

      To allow a better management of the positioning of the labels of a bar chart, it is possible to indicate another letter, that is the letter i. The introduction of this letter serves to indicate that the label will be inserted inside the elements rather than outside. If the letter i is indicated, the labels will appear only if they are entirely contained within the element.

    • setITEMLABELFONT

      public void setITEMLABELFONT(String s)
      Sets the font used for the label of the items of the chart
      Parameters:
      s - A string that defines the font, with the format: name,variant,dimension,color. See JFCSerie.setDOMAINTITLEFONT(java.lang.String)
    • setITEMBACKGROUNDCOLOR

      public void setITEMBACKGROUNDCOLOR(String s)
      Sets the background color of the data area of the chart
      Parameters:
      s - The background color. The format for the color is described in the JFCStyle class.
    • setITEMINSETBACKGROUNDCOLOR

      public void setITEMINSETBACKGROUNDCOLOR(String s)
      Sets the background color of the data inset area of the chart (only if the chart has a three dimensional design)
      Parameters:
      s - The background color. The format for the color is described in the JFCStyle class.
    • setITEMLABELFORMAT

      public void setITEMLABELFORMAT(String s)
      Sets the TextFormat used for the labels of the elements of each serie
      Parameters:
      s - A LIST} in which every element, separated from the others by the | character, represents the format used for the labels of the elements of the corresponding serie
    • setLEGENDFONT

      public void setLEGENDFONT(String s)
      Sets the font for the text item in the legend.
      Parameters:
      s - The font to set.
    • setLEGENDBOX

      public void setLEGENDBOX(String s)
      Defines the characteristics of the legend box
      Parameters:
      s - A string that defines the format.
      It must be composed by a serie of strings, separated by the comma, with the following meaning: position,background color,border thickness,border color.
      The possible values for the position are: t (top), b (bottom), l (left), r (right).
      The format for the colors is described in the JFCStyle class.
      The thickness value must be a number.
      You can omit some values, in which case you fall back to the default ones
    • setLABELS

      public void setLABELS(String s)
      Sets the labels used in the legend box
      Parameters:
      s - A list in which every element, separated from the others by the | character, represents the label that will appear in the legend box
    • setJFCSerie

      public void setJFCSerie(JFCSerie pie)
      Sets the JFCSerie chart.
      Parameters:
      pie - The chart to set.
    • setJFCStyle

      public void setJFCStyle(JFCStyle jfcs)
      Sets the JFCStyle used to draw the serie chart elements
      Parameters:
      jfcs - The style used to draw the elements of the chart
    • getJFCStyle

      protected JFCStyle getJFCStyle()
    • addSerie

      public void addSerie(char type, overit.geocall.charts.Serie s)
      Add a data Serie to the graph.
      Parameters:
      type - The possible type values are:
      • 'b' - bar serie
      • 'a' - area serie
      • 'l' - line serie
      s - The Serie to add.
    • drawInsideFront

      public void drawInsideFront(Report r, float x, float y, float w, float h)
      Draw the Serie graph inside the box of the report.
      Overrides:
      drawInsideFront in class PdfBox
      Parameters:
      r - The report where draw the Serie graph box.
      x - The x coordinate from which start draw.
      y - The y coordinate from which start draw.
      w - The width of the box.
      h - The height of the box.
    • setMinimumImgSize

      protected void setMinimumImgSize()
    • setAttributes

      protected void setAttributes(JFCSerie chart)
    • addSeries

      protected void addSeries(JFCSerie chart)