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
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
Fields inherited from class AbstractBuilder
METHOD_BUILD
Fields inherited from class ObjectIdentity
classId, idGenerator, instanceId, invocations, m, NONE, parentObjectIdentity
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractChartBuilder
(String classId, IdGenerator idGenerator, Invocations<MethodInvocation> invocations) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
addInvocation
(String methodName, Object... arguments) protected ChartBuilderResult
fromQueryBuilderState
(Map<String, Object> state) Configures aDataTableChart
based on the output of theQueryBuilder
Dashboard input.final Dictionary
<C> abstract AbstractChartOptions
<C, ?> protected C
getThis()
protected String
protected String
protected String
layout()
Portlet
withDragDrop
(boolean enabled) Enables or disables the drag&drop feature for portlets.Portlet
withHeight
(int height) Builder style method for setting the height in pixels.Portlet
withHeight
(int height, String unit) Builder style method for setting the height in supported units.Portlet
withLayout
(int width, int height) Builder style method for setting width and height in pixels.Portlet
withLayout
(int width, int height, String unit) Builder style method for setting width and height in specified units.Portlet
withLayout
(int width, int height, String wUnit, String hUnit) Portlet
withResizing
(boolean enabled) Enables or disables the resizing feature for portlets.Portlet
withWidth
(int width) Builder style method for setting the width in pixels.Portlet
Builder style method for setting the width in supported units.Methods inherited from class AbstractBuilder
build
Methods inherited from class ObjectIdentity
addInvocation
-
Field Details
-
layout
-
queryBuilderState
-
dragDropEnabled
protected boolean dragDropEnabled -
resizingEnabled
protected boolean resizingEnabled
-
-
Constructor Details
-
AbstractChartBuilder
protected AbstractChartBuilder(String classId, IdGenerator idGenerator, Invocations<MethodInvocation> invocations)
-
-
Method Details
-
addInvocation
- Overrides:
addInvocation
in classObjectIdentity
-
getThis
-
getDictionary
-
invokeGetOptions
-
getOptions
-
invokeAddSeries
-
invokeGetSeries
-
addAuxLine
-
onRowClick
-
onCellClick
-
build
-
withWidth
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):
Example – setting the width using pixels:portlet.withWidth(12, "grid")
portlet.withWidth(400, "px") // == portlet.withWidth(400)
-
withHeight
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):
Example – setting the height using pixels:portlet.withHeight(12, "grid")
portlet.withHeight(800, "px") // == portlet.withHeight(800)
- Specified by:
withHeight
in 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 thenpx
is used as default.- Returns:
- The current portlet object of the specified size.
- See Also:
-
withLayout
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 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:
-
withLayout
-
value
-
withWidth
public Portlet withWidth(int width) Description copied from interface:Portlet
Builder style method for setting the width in pixels. -
withHeight
public Portlet withHeight(int height) Description copied from interface:Portlet
Builder style method for setting the height in pixels.- Specified by:
withHeight
in 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:Portlet
Builder style method for setting width and height in pixels.- Specified by:
withLayout
in 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 aDataTableChart
based on the output of theQueryBuilder
Dashboard 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
- PropertiesMap
as returned by theQueryBuilder
input- 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:Portlet
Enables or disables the drag&drop feature for portlets. Set tofalse
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 interfacePortlet
- Parameters:
enabled
- on/off switch. Default =true
.- Returns:
- this Portlet instance
-
withResizing
public Portlet withResizing(boolean enabled) Description copied from interface:Portlet
Enables or disables the resizing feature for portlets. Set tofalse
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 interfacePortlet
- Parameters:
enabled
- on/off switch. Default =true
.- Returns:
- this Portlet instance
-