Class AbstractChartBuilder<C extends AbstractChartBuilder<C>>

Object
ObjectIdentity
AbstractBuilder
AbstractChartBuilder<C>
All Implemented Interfaces:
Portlet, Portlet
Direct Known Subclasses:
BarLineChart, BoxplotChart, BubbleChart, DataTableChart, DetailedTimeSeriesChart, HeatmapChart, HistogramChart, PieChart, ScatterChart, TimeSeriesChart, TimeSeriesScatterChart, WaterfallChart, WaterfallComparisonChart

public abstract class AbstractChartBuilder<C extends AbstractChartBuilder<C>> extends AbstractBuilder implements Portlet
  • Field Details Link icon

    • layout Link icon

      protected Map<String,Object> layout
    • queryBuilderState Link icon

      protected Map<String,Object> queryBuilderState
    • messages Link icon

      protected Map<String,List<PortletMessage>> messages
    • dragDropEnabled Link icon

      protected boolean dragDropEnabled
    • resizingEnabled Link icon

      protected boolean resizingEnabled
  • Constructor Details Link icon

    • AbstractChartBuilder Link icon

      protected AbstractChartBuilder(String classId, IdGenerator idGenerator, Invocations<MethodInvocation> invocations)
  • Method Details Link icon

    • addInvocation Link icon

      protected String addInvocation(String methodName, Object... arguments)
      Overrides:
      addInvocation in class ObjectIdentity
    • getThis Link icon

      protected C getThis()
    • getDictionary Link icon

      public final Dictionary<C> getDictionary()
    • invokeGetOptions Link icon

      protected String invokeGetOptions()
    • getOptions Link icon

      public abstract AbstractChartOptions<C,?> getOptions()
    • invokeAddSeries Link icon

      protected String invokeAddSeries()
    • invokeGetSeries Link icon

      protected String invokeGetSeries()
    • addAuxLine Link icon

      protected AuxLine<C> addAuxLine()
    • onRowClick Link icon

      public ChartEvents.OnRowClick<C> onRowClick()
    • onCellClick Link icon

      public ChartEvents.OnCellClick<C> onCellClick()
    • build Link icon

      protected ChartBuilderResult build(ChartType type)
    • withWidth Link icon

      public Portlet withWidth(int width, String unit)
      Description copied from interface: Portlet
      Builder style method for setting the width in supported units.

      Example – setting the width using the 12-column system (grid):

      
       portlet.withWidth(12, "grid")
       
      Example – setting the width using pixels:
      
       portlet.withWidth(400, "px") // == portlet.withWidth(400)
       
      Specified by:
      withWidth in interface Portlet
      Parameters:
      width - Specifies the width of the portlet (in unit).
      unit - Specifies the unit of the width (grid, px). If the unit is not specified then px is used as default.
      Returns:
      The current portlet object of the specified size.
      See Also:
    • withHeight Link icon

      public Portlet withHeight(int height, String unit)
      Description copied from interface: Portlet
      Builder style method for setting the height in supported units.

      Example – setting the height using the 12-column system (grid):

      
       portlet.withHeight(12, "grid")
       
      Example – setting the height using pixels:
      
       portlet.withHeight(800, "px") // == portlet.withHeight(800)
       
      Specified by:
      withHeight in interface Portlet
      Parameters:
      height - Specifies the height of the portlet (in unit).
      unit - Specifies the unit of the height (grid, px). If the unit is not specified then px is used as default.
      Returns:
      The current portlet object of the specified size.
      See Also:
    • withLayout Link icon

      public Portlet withLayout(int width, int height, String unit)
      Description copied from interface: Portlet
      Builder style method for setting width and height in specified units.

      Example - sets the portlet size to the specified grid size:

      
       def matrix = api.newMatrix("column1", "column2", "column3")
            matrix.addRow(1, "a", "f")
            matrix.addRow(2, "b", "g")
            matrix.withLayout(3, 3, "grid")
      
       return matrix
       
      Specified by:
      withLayout in interface Portlet
      Parameters:
      width - Specifies the width of the portlet.
      height - Specifies the height of the portlet.
      unit - Specifies a unit of the layout (grid, px).
      Returns:
      The current portlet object of the specified size.
      See Also:
    • withInfo Link icon

      public Portlet withInfo(String code, String userMsg, String techMsg)
      Description copied from interface: Portlet
      Adds an info message to the given portlet. One portlet can have multiple messages. It is a different concept than yellow/red alerts.
      Example:
      
       portlet.withInfo("101", "Chart data may be outdated", "Bubble Chart data is outdated, because of ...")
       
      Specified by:
      withInfo in interface Portlet
      Parameters:
      code - Info code allows to pinpoint the place of the related issue in code.
      userMsg - Info message is displayed to a user in UI.
      techMsg - Technical message is hidden by default, only for the investigation purposes.
    • withWarning Link icon

      public Portlet withWarning(String code, String userMsg, String techMsg)
      Description copied from interface: Portlet
      Adds a warning message to the given portlet. One portlet can have multiple messages. It is a different concept than yellow/red alerts.
      Example:
      
       portlet.withWarning("102", "Chart data is missing", "Bubble Chart data is missing, because of ...")
       
      Specified by:
      withWarning in interface Portlet
      Parameters:
      code - Warning code allows to pinpoint the place where the warning is thrown in code.
      userMsg - Warning message is displayed to a user in UI.
      techMsg - Technical message is hidden by default, only for the investigation purposes.
    • withError Link icon

      public Portlet withError(String code, String userMsg, String techMsg)
      Description copied from interface: Portlet
      Adds an error message to the given portlet. One portlet can have multiple messages. It is a different concept than yellow/red alerts.
      Example:
      
       portlet.withError("103", "Chart was not found", "Bubble Chart could not be found, because of ...")
       
      Specified by:
      withError in interface Portlet
      Parameters:
      code - Error code allows to pinpoint the place where the error is thrown in code.
      userMsg - Error message is displayed to a user in UI.
      techMsg - Technical message is hidden by default, only for the investigation purposes.
    • withLayout Link icon

      public Portlet withLayout(int width, int height, String wUnit, String hUnit)
    • value Link icon

      protected Map<String,Object> value(int value, String unit)
    • withWidth Link icon

      public Portlet withWidth(int width)
      Description copied from interface: Portlet
      Builder style method for setting the width in pixels.
      Specified by:
      withWidth in interface Portlet
      Parameters:
      width - specify the width of the portlet (in pixels)
      Returns:
      The current portlet object of the specified size.
      See Also:
    • withHeight Link icon

      public Portlet withHeight(int height)
      Description copied from interface: Portlet
      Builder style method for setting the height in pixels.
      Specified by:
      withHeight in interface Portlet
      Parameters:
      height - specify the height of the portlet (in pixels)
      Returns:
      The current portlet object of the specified size.
      See Also:
    • withLayout Link icon

      public Portlet withLayout(int width, int height)
      Description copied from interface: Portlet
      Builder style method for setting width and height in pixels.
      Specified by:
      withLayout in interface Portlet
      Parameters:
      width - specify the width of the portlet (in pixels)
      height - specify the height of the portlet (in pixels)
      Returns:
      The current portlet object of the specified size.
      See Also:
    • layout Link icon

      protected Map<String,Object> layout()
    • fromQueryBuilderState Link icon

      public C fromQueryBuilderState(Map<String,Object> state)
      Configures a DataTableChart based on the output of the QueryBuilder Dashboard input.
      Note: So far the only supported chart type is DataTable, which will show a separate tab for each series configured in the QueryBuilder input.

      Example:

      
       def qbState = input.MyQueryBuilder
       api.newChartBuilder()
           .newDataTable()
           .fromQueryBuilderState(qbState)
           .build()
       
      Parameters:
      state - Properties Map as returned by the QueryBuilder input
      Returns:
      self
      Since:
      11.0 Paper Plane for DataTableChart, 12.0 Clover Club experimental for all other chart types
    • withDragDrop Link icon

      public Portlet withDragDrop(boolean enabled)
      Description copied from interface: Portlet
      Enables or disables the drag&drop feature for portlets. Set to false to disable the drag&drop option. Default state is ENABLED.

      Example - disables the drag&drop of the Result Matrix portlet:

      
       def matrix = api.newMatrix("column1", "column2", "column3")
            matrix.addRow(1, "a", "f")
            matrix.addRow(2, "b", "g")
            matrix.withDragDrop(false)
      
       return matrix
       
      Specified by:
      withDragDrop in interface Portlet
      Parameters:
      enabled - on/off switch. Default = true.
      Returns:
      this Portlet instance
    • withResizing Link icon

      public Portlet withResizing(boolean enabled)
      Description copied from interface: Portlet
      Enables or disables the resizing feature for portlets. Set to false to disable the resizing of the portlet. Default state is ENABLED.

      Example - disables the resizing option of the Result Matrix portlet:

      
       def matrix = api.newMatrix("column1", "column2", "column3")
            matrix.addRow(1, "a", "f")
            matrix.addRow(2, "b", "g")
            matrix.withResizing(false)
      
       return matrix
       
      Specified by:
      withResizing in interface Portlet
      Parameters:
      enabled - on/off switch. Default = true.
      Returns:
      this Portlet instance
    • withTab Link icon

      public Portlet withTab(String tabName)
      Description copied from interface: Portlet
      Assigns the portlet to a specific tab in a multitab dashboard.

      Tabs must be defined in the Model Class (MC) definition under the dashboardTabs list for the corresponding step.
      If the tab name is not found in the MC definition, the portlet falls back to the default tab and a warning is logged to the console.

      Example:

      
           return api.inputBuilderFactory().createInputMatrix("MatrixEntry")
                   .setColumns(columns)
                   .setColumnValueOptions(columnsValueOptions)
                   .setValue([
                       [col1: "a1", col2: "b1"],
                       [col1: "a2", col2: "b2"]
                   ])
                   .setLabel("MatrixEntry")
                   .setTab("multitab_dashboard_inputs_and_portlets")
                   .getInput()
       
      Specified by:
      withTab in interface Portlet
      Parameters:
      tabName - Name of the tab as defined in dashboardTabs in the Model Class JSON
      Returns:
      the current portlet instance
      See Also: