Interface ResultHighchart.OnPointClick
- Enclosing class:
ResultHighchart
public static interface ResultHighchart.OnPointClick
Defines what happens when the user clicks a point in the chart. Get it from
ResultHighchart.onPointClick().
A click can either trigger events with triggerEvent(String) or open a context menu with
showContextMenu(). One chart cannot use both.
- Since:
- 3.7.1 - Bramble
-
Method Summary
Modifier and TypeMethodDescriptionback()Returns to the chart.Define a set of Context Linking options in a menu that will show when the user clicks in the chart.triggerEvent(String eventName) Define an event that will be triggered when the user clicks in the chart.
-
Method Details
-
triggerEvent
Define an event that will be triggered when the user clicks in the chart.
The name of the event is set as a parameter, the desired payload of the event can be set using instance methods of the returnedResultHighchart.TriggerEvent
Warning: this option is not compatible withshowContextMenu(). Calling bothtriggerEvent()andshowContextMenu()will throw anIllegalArgumentException.- Parameters:
eventName- the name of the event- Returns:
- a new
ResultHighchart.TriggerEventinstance - Throws:
IllegalArgumentException- ifeventNameisnullor empty, or ifshowContextMenu()was already called for this chart
-
showContextMenu
ResultHighchart.ContextMenu showContextMenu()Define a set of Context Linking options in a menu that will show when the user clicks in the chart.
If a drilldown was defined, the first menu item will allow to trigger the drilldown. And the menu item's label can be customized withResultHighchart.ContextMenu.setDrilldownLabel(String)andResultHighchart.ContextMenu.setDrilldownLabelTranslations(Map)
Warning: this option is not compatible withtriggerEvent(String). Calling bothtriggerEvent()andshowContextMenu()will throw anIllegalArgumentException.Example:
import net.pricefx.formulaengine.scripting.AppPages return api.buildHighchart(definition) .onPointClick() .showContextMenu() .addMenuItem() .setLabel("Go to Customer Detail") .setOrder(1) .setContextLinking([ targetPage : AppPages.DB_DASHBOARDS_PAGE, id : "CustomerDetail", targetPageTarget: "new", targetPageInputs: [Customer: "{point.options.customerId}"] ]) .back() .back() .back()- Returns:
- a new
ResultHighchart.ContextMenuinstance - Throws:
IllegalArgumentException- if this method was already called for this chart, or iftriggerEvent(String)was already called for it- Since:
- 14.0 - Caribou Lou
- See Also:
-
back
ResultHighchart back()Returns to the chart.- Returns:
- the
ResultHighchartinstance, for convenience
-