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 Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanFields inherited from class AbstractBuilder
METHOD_BUILDFields inherited from class ObjectIdentity
classId, idGenerator, instanceId, invocations, m, NONE, parentObjectIdentity -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractChartBuilder(String classId, IdGenerator idGenerator, Invocations<MethodInvocation> invocations) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringaddInvocation(String methodName, Object... arguments) protected ChartBuilderResultfromQueryBuilderState(Map<String, Object> state) Configures aDataTableChartbased on the output of theQueryBuilderDashboard input.final Dictionary<C> abstract AbstractChartOptions<C, ?> protected CgetThis()protected Stringprotected Stringprotected Stringlayout()PortletwithDragDrop(boolean enabled) Enables or disables the drag&drop feature for portlets.PortletAdds an error message to the given portlet.PortletwithHeight(int height) Builder style method for setting the height in pixels.PortletwithHeight(int height, String unit) Builder style method for setting the height in supported units.PortletAdds an info message to the given portlet.PortletwithLabelOverride(String label) Overrides the default label of a portlet.PortletwithLayout(int width, int height) Builder style method for setting width and height in pixels.PortletwithLayout(int width, int height, String unit) Builder style method for setting width and height in specified units.PortletwithLayout(int width, int height, String wUnit, String hUnit) PortletwithResizing(boolean enabled) Enables or disables the resizing feature for portlets.PortletAssigns the portlet to a specific tab in a multitab dashboard.PortletwithWarning(String code, String userMsg, String techMsg) Adds a warning message to the given portlet.PortletwithWidth(int width) Builder style method for setting the width in pixels.PortletBuilder style method for setting the width in supported units.Methods inherited from class AbstractBuilder
buildMethods inherited from class ObjectIdentity
addInvocation
-
Field Details
-
layout
-
queryBuilderState
-
messages
-
dragDropEnabled
protected boolean dragDropEnabled -
resizingEnabled
protected boolean resizingEnabled
-
-
Constructor Details
-
AbstractChartBuilder
protected AbstractChartBuilder(String classId, IdGenerator idGenerator, Invocations<MethodInvocation> invocations)
-
-
Method Details
-
addInvocation
- Overrides:
addInvocationin classObjectIdentity
-
getThis
-
getDictionary
-
invokeGetOptions
-
getOptions
-
invokeAddSeries
-
invokeGetSeries
-
addAuxLine
-
onRowClick
-
onCellClick
-
build
-
withWidth
Description copied from interface:PortletBuilder style method for setting the width in supported units.Example – setting the width using the 12-column system (grid):
Example – setting the width using pixels:portlet.withWidth(12, "grid")portlet.withWidth(400, "px") // == portlet.withWidth(400) -
withHeight
Description copied from interface:PortletBuilder style method for setting the height in supported units.Example – setting the height using the 12-column system (grid):
Example – setting the height using pixels:portlet.withHeight(12, "grid")portlet.withHeight(800, "px") // == portlet.withHeight(800)- Specified by:
withHeightin interfacePortlet- 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 thenpxis used as default.- Returns:
- The current portlet object of the specified size.
- See Also:
-
withLayout
Description copied from interface:PortletBuilder 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:
withLayoutin interfacePortlet- 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
Description copied from interface:PortletAdds 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 ...") -
withWarning
Description copied from interface:PortletAdds 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:
withWarningin interfacePortlet- Parameters:
code- Warning code allows pinpointing the place where the warning is thrown in code.userMsg- A warning message is displayed to a user in UI.techMsg- Technical message is hidden by default, only for the investigation purposes.
-
withError
Description copied from interface:PortletAdds 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 ...") -
withLayout
-
value
-
withWidth
public Portlet withWidth(int width) Description copied from interface:PortletBuilder style method for setting the width in pixels. -
withHeight
public Portlet withHeight(int height) Description copied from interface:PortletBuilder style method for setting the height in pixels.- Specified by:
withHeightin interfacePortlet- Parameters:
height- specify the height of the portlet (in pixels)- Returns:
- The current portlet object of the specified size.
- See Also:
-
withLayout
public Portlet withLayout(int width, int height) Description copied from interface:PortletBuilder style method for setting width and height in pixels.- Specified by:
withLayoutin interfacePortlet- 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
-
fromQueryBuilderState
Configures aDataTableChartbased on the output of theQueryBuilderDashboard input.
Note: So far the only supported chart type isDataTable, 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- PropertiesMapas returned by theQueryBuilderinput- Returns:
- self
- Since:
- 11.0 Paper Plane for DataTableChart, 12.0 Clover Club experimental for all other chart types
-
withDragDrop
public Portlet withDragDrop(boolean enabled) Description copied from interface:PortletEnables or disables the drag&drop feature for portlets. Set tofalseto disable the drag&drop option. The 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:
withDragDropin interfacePortlet- Parameters:
enabled- on/off switch. Default =true.- Returns:
- this Portlet instance
-
withResizing
public Portlet withResizing(boolean enabled) Description copied from interface:PortletEnables or disables the resizing feature for portlets. Set tofalseto disable the resizing of the portlet. The 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:
withResizingin interfacePortlet- Parameters:
enabled- on/off switch. Default =true.- Returns:
- this Portlet instance
-
withTab
Description copied from interface:PortletAssigns the portlet to a specific tab in a multitab dashboard.Tabs must be defined in the Model Class (MC) definition under the
dashboardTabslist 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() -
withLabelOverride
Description copied from interface:PortletOverrides the default label of a portlet. This method is implemented for the subtypes of AbstractPortletDto and AbstractChartBuilder only.- Specified by:
withLabelOverridein interfacePortlet- Parameters:
label- Suggested new label- Returns:
- the current portlet instance
-