Class ResultHighchart
- Object
-
- ResultHighchart
-
- All Implemented Interfaces:
Serializable,ComplexCalculationResult
- Direct Known Subclasses:
ResultHighmap
public class ResultHighchart extends Object implements ComplexCalculationResult
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceResultHighchart.OnPointClickstatic interfaceResultHighchart.TriggerEvent
-
Constructor Summary
Constructors Constructor Description ResultHighchart(Map<String,?> definition)Not intended for public use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResultHighchartaddModule(String... modules)By default, these modules are already available: boost, drilldown, exporting, export-data, heatmap, no-data-to-display, treemap.ResultHighchartaddResultMatrixTab(ResultMatrix matrix)The automatically filled data tab can be replaced by customized ResultMatrix data.Map<String,?>getChartDefinition()Not intended for public use, required for JSON serialization.List<String>getDataHeaders()Not intended for public use, required for JSON serialization.List<Map<String,String>>getEvents()Not intended for public use, required for JSON serialization.List<String>getModulesList()Not intended for public use, required for JSON serialization.List<ResultMatrix>getResultMatrixList()Not intended for public use, required for JSON serialization.StringgetResultType()booleangetShowDataTab()Not intended for public use, required for JSON serialization.ResultHighchart.OnPointClickonPointClick()BETA
Allows to define events that will be triggered when the user clicks in the chart/map.ResultHighchartsetDataHeaders(String... headers)To override the default column headers of the data tab table.ResultHighchartsetResultMatrixTabs(ResultMatrix... matrices)The automatically filled data tab can be replaced by customized ResultMatrix data.ResultHighchartsetShowDataTab(boolean show)Show a tab set, with the chart in the first tab, and data grids in the other tabs.ResultHighchartshowDataTab()Short forsetShowDataTab(true)
-
-
-
Method Detail
-
getChartDefinition
public Map<String,?> getChartDefinition()
Not intended for public use, required for JSON serialization.
-
addModule
public ResultHighchart addModule(String... modules)
By default, these modules are already available: boost, drilldown, exporting, export-data, heatmap, no-data-to-display, treemap. If your chart requires additional modules, they can be specified here. The application ensures the files load only once.Note regarding the "boost" module: The Highcharts documentation states that it is enabled by default, but in Pricefx you will need to explicitly set the option
boost.enabled = true- Parameters:
modules- one or more Highcharts module names, without the path and without the ".js" extension. e.g. "annotations", "funnel", "variwide"- Returns:
- the
ResultHighchartinstance, for convenience - See Also:
- https://www.highcharts.com/docs to find out what modules are needed for each chart type.
-
getModulesList
public List<String> getModulesList()
Not intended for public use, required for JSON serialization.
-
setShowDataTab
public ResultHighchart setShowDataTab(boolean show)
Show a tab set, with the chart in the first tab, and data grids in the other tabs. By default, a single grid will be shown by extracting the data using the native JavaScript Highcharts API. The headers of this grid can be customized viasetDataHeaders(), or the whole grid can be provided in aResultMatrixinstance viasetResultMatrixTabs(). Note that for convenience, callingsetDataHeaders(),setResultMatrixTabs(), oraddResultMatrixTab()will set this to true.- Parameters:
show- Data tab will be shown if set to true. Default is false.- Returns:
- the
ResultHighchartinstance, for convenience - See Also:
setDataHeaders(java.lang.String...),setResultMatrixTabs(net.pricefx.server.dto.calculation.ResultMatrix...),addResultMatrixTab(net.pricefx.server.dto.calculation.ResultMatrix)
-
showDataTab
public ResultHighchart showDataTab()
Short forsetShowDataTab(true)- Returns:
- the
ResultHighchartinstance, for convenience
-
getShowDataTab
public boolean getShowDataTab()
Not intended for public use, required for JSON serialization.
-
setDataHeaders
public ResultHighchart setDataHeaders(String... headers)
To override the default column headers of the data tab table. For convenience, this will also callsetShowDataTab(true)- Parameters:
headers- One or more header labels, left to right- Returns:
- the
ResultHighchartinstance, for convenience
-
getDataHeaders
public List<String> getDataHeaders()
Not intended for public use, required for JSON serialization.
-
setResultMatrixTabs
public ResultHighchart setResultMatrixTabs(ResultMatrix... matrices)
The automatically filled data tab can be replaced by customized ResultMatrix data. It's even possible to add multiple tabs by providing multiple ResultMatrix instances. Make sure to set a title viaResultMatrix.setTitle()as this will be used for the tab label. Note that:- This method will overwrite any previously set or added
ResultMatrix - For convenience, this will also call
setShowDataTab(true)
- Parameters:
matrices- One or more ResultMatrix instances to display in the tab set- Returns:
- the
ResultHighchartinstance, for convenience - See Also:
setShowDataTab(boolean)
- This method will overwrite any previously set or added
-
addResultMatrixTab
public ResultHighchart addResultMatrixTab(ResultMatrix matrix)
The automatically filled data tab can be replaced by customized ResultMatrix data. It's even possible to add multiple tabs by providing multiple ResultMatrix instances. Make sure to set a title viaResultMatrix.setTitle()as this will be used for the tab label. Note that:- This method will not overwrite previously set or added
ResultMatrix - For convenience, this will also call
setShowDataTab(true)
- Parameters:
matrix- Add one ResultMatrix instance to display in its own tab- Returns:
- the
ResultHighchartinstance, for convenience - See Also:
setShowDataTab(boolean)
- This method will not overwrite previously set or added
-
getResultMatrixList
public List<ResultMatrix> getResultMatrixList()
Not intended for public use, required for JSON serialization.
-
getResultType
public String getResultType()
- Specified by:
getResultTypein interfaceComplexCalculationResult
-
onPointClick
public ResultHighchart.OnPointClick onPointClick()
BETA
Allows to define events that will be triggered when the user clicks in the chart/map.
Example:def chart = api.buildHighchart(definition) chart.onPointClick().triggerEvent(api.dashboardWideEvent("eventName")) .withNameAsEventDataAttr().withCustomEventDataAttr("value") return chartThis allows to refresh an embedded dashboard:return api.dashboard("embeddedDashboardName") //.setParam("country_name", api.input("Country")) //.setParam("country_revenue", api.input("Revenu")) .showEmbedded() .andRecalculateOn(api.dashboardWideEvent("eventName")) .withEventDataAttr("name").asParam("country_name) .withEventDataAttr("value").asParam("country_revenue")
-
-