Class ChartBase

All Implemented Interfaces:
Serializable, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, Arrangeable, Badgeable, Identified, Tool, overit.geocall.ux.configurability.UIConfigurable, overit.geocall.ux.edm.ModelConfigurable
Direct Known Subclasses:
ChartPie, ChartSerie

public abstract class ChartBase extends Control implements Arrangeable
The base UI component for Charts
See Also:
  • Constructor Details

    • ChartBase

      protected ChartBase(Holder<ChartScriptBuilder> chartScriptBuilderHolder)
      Creates a new instance of ChartBase
      Parameters:
      chartScriptBuilderHolder - The holder for the chart script builder, it must create a new instance each time it is called.
  • Method Details

    • hasFixedSize

      public boolean hasFixedSize()
      Indicates if the chart has a fixed size.
      Returns:
      true if the chart has a fixed size, false otherwise
    • getWidth

      public int getWidth()
      Gets the width of the chart.
      Returns:
      The width of the chart.
    • setWidth

      public void setWidth(int width)
      Sets the width of the chart.
      Parameters:
      width - The width of the chart.
    • setWIDTH

      public void setWIDTH(String s)
      Sets the width of the chart.
      Parameters:
      s - The width of the chart.
    • getHeight

      public int getHeight()
      Gets the height of the chart.
      Returns:
      The height of the chart.
    • setHeight

      public void setHeight(int height)
      Sets the height of the chart.
      Parameters:
      height - The height of the chart.
    • setHEIGHT

      public void setHEIGHT(String s)
      Sets the height of the chart.
      Parameters:
      s - The height of the chart.
    • getLegendFont

      public overit.geocall.charts.ChartFont getLegendFont()
      Returns the font used for the legend.
      Returns:
      The font used for the legend
    • setLegendFont

      public void setLegendFont(overit.geocall.charts.ChartFont legendFont)
      Sets the font used for the legend.
      Parameters:
      legendFont - The font used for the legend
    • setLEGENDFONT

      public void setLEGENDFONT(String s)
      Sets the font used for the legend.
      Parameters:
      s - A string that defines the font, with the format: name,variant,dimension,color.
    • getLegendBox

      public overit.geocall.charts.ChartLegendBox getLegendBox()
      Returns the legend box.
      Returns:
      The legend box
    • setLegendBox

      public void setLegendBox(overit.geocall.charts.ChartLegendBox legendBox)
      Sets the legend box.
      Parameters:
      legendBox - The legend box
    • setLEGENDBOX

      public void setLEGENDBOX(String s)
      Sets the legend box, it supports only the position
      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.
    • isLegend

      public boolean isLegend()
      Returns true if the legend is shown, false otherwise.
      Returns:
      True if the legend is shown, false otherwise
    • setLegend

      public void setLegend(boolean legend)
      Sets if the legend is shown or not.
      Parameters:
      legend - True if the legend is shown, false otherwise
    • setLEGEND

      public void setLEGEND(String s)
      Sets if the legend is shown 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
    • getItemSize

      public double getItemSize()
      Returns the size of the legend items.
      Returns:
      The size of the legend items
    • setItemSize

      public void setItemSize(double itemSize)
      Sets the size of the legend items.
      Parameters:
      itemSize - The size of the legend items
    • setITEMSIZE

      public void setITEMSIZE(String s)
      Sets the size of the legend items.
      Parameters:
      s - The size of the legend items
    • getChartStyle

      protected ChartStyle getChartStyle()
    • setChartStyle

      public void setChartStyle(ChartStyle cs)
      Sets the ChartStyle used to draw the pie chart elements
      Parameters:
      cs - The style used to draw the elements of the chart
    • setup

      protected void setup()
      Description copied from class: Component
      Setup the Component
      Overrides:
      setup in class Component
    • getHtml

      public org.apache.ecs.Element getHtml(EntitySet es)
      Description copied from class: Component
      Abstract method that must be extended and returns the html code of the Component
      Specified by:
      getHtml in class Component
      Parameters:
      es - The EntitySet to which the element belongs
      Returns:
      The html of the Component
    • getGenerationHandle

      public Object getGenerationHandle()
      Description copied from interface: Arrangeable
      Returns the object to generate when the Arrangeable element is composed by more than one element
      Specified by:
      getGenerationHandle in interface Arrangeable
      Returns:
      The Object to generate
    • getDescriptionHtml

      public org.apache.ecs.Element getDescriptionHtml(Object generationHandle, EntitySet es)
      Description copied from interface: Arrangeable
      Returns the html code that represents the component description i.e. the formatted label of the field
      Specified by:
      getDescriptionHtml in interface Arrangeable
      Parameters:
      generationHandle - the unique generatin handle
      es - the page entity set
      Returns:
      The html code of the label of the field
    • getContentHtml

      public org.apache.ecs.Element getContentHtml(Object generationHandle, EntitySet es)
      Description copied from interface: Arrangeable
      Returns the html code that represents the active part of the component, i.e. the field and the validation scripts
      Specified by:
      getContentHtml in interface Arrangeable
      Parameters:
      generationHandle - the unique generatin handle
      es - the page entity set
      Returns:
      The html code of the component
    • getMessages

      protected org.apache.ecs.Element getMessages(List<ChartMessage> messages, EntitySet es)
    • getMessages

      protected List<ChartMessage> getMessages()
    • getHiddenHtml

      public org.apache.ecs.Element getHiddenHtml(Object generationHandle, EntitySet es)
      Description copied from interface: Arrangeable
      Returns the hidden but active html part of an hidden component
      Specified by:
      getHiddenHtml in interface Arrangeable
      Parameters:
      generationHandle - the unique generatin handle
      es - the page entity set
      Returns:
      The html code of the hidden part of the component
    • getChartScriptBuilderHolder

      protected Holder<ChartScriptBuilder> getChartScriptBuilderHolder()
    • buildSetupScript

      public void buildSetupScript(StringBuilder sb)
      Description copied from class: Component
      Every component can add a script to the StringBuilder, script executed when the component is created.
      Overrides:
      buildSetupScript in class Component
      Parameters:
      sb - The StringBuilder on which we want to add the script
    • addEventHandlers

      protected void addEventHandlers(ChartScriptBuilder scriptBuilder)
    • buildJsonChartConfig

      protected abstract String buildJsonChartConfig()
    • chartChanged

      protected void chartChanged()