On Series Click on Advanced Bar Chart: no context data (Serie/X/Y) passed to action

We have an Advanced Bar Chart and wanted to define a custom on-click event. We followed the instructions in the docs for the event handler, but can’t get it to work.

According to the docs, the event should expose Serie, X, and Y values from the clicked data point into the triggered action, but the Context data comes back empty.

Setup:

  • The chart’s Category Property is a Datetime grouped by month, and the Value Property is aggregated with Sum.
  • Chart’s On Series Click calls an action with matching params: X (datetime), Serie (string), Y (float).
  • For now, the action only writes the action params to app variables.
  • We tried binding the params explicitly and leaving them unbound, in case the values are passed implicitly by name.

After clicking a bar, none of the three App Variables update. The action params appear to always be empty.

I checked the Showroom but couldn’t find any examples of charts using On series click.
Has anyone gotten this to work? Is our setup wrong, or is this a platform issue?

Hi Joanna,

Thanks for the detailed write-up!

Your setup is correct, and you’ve found a bug on our side. When you bind action params in the On Series Click event, the X output is always treated as a Float, whatever your Category Property is. Because the picker only offers outputs whose type matches the param, your Datetime X param is never offered the X output. That’s why it stays empty. We’re logging this with the team so it can be fixed.

This explains X, but it shouldn’t stop Serie and Y from coming through. Could you help us check a few things?

  1. When you bind the params explicitly, which event outputs appear in the list for each param? Is X missing for the Datetime param while Serie and Y are there?
  2. If you bind only Serie and click a bar, does its App Variable update? A quick way to check whether the action runs at all is to add a Show Message node as the first step.
  3. Is Disable tracking turned on in the chart’s properties? It switches off mouse interaction, so clicks never reach the event handler.

About leaving the params unbound: values aren’t passed by matching names, so each param needs an explicit binding to an event output.

We’ll update this thread when the fix is out. Sorry for the trouble!

Hi Olav,

Thank you for the reply.

These data bindings were not available when I originally posted. Not sure if a new version has been released since, or if it was some other issue.

Regarding X, I bound it to a float param now, and I can see all 3 values being passed (although the datetime is treated as a float so the output is not correct).

Two follow-up questions:

  • do I understand it right that in order to be able to use a click event, we wouldn’t be able to turn off the default on hover event?
  • is there a way to get information about all series from a stacked bar, or is the current setup limited to the specific serie that’s clicked only?

Hi Joanna,

Thanks for checking, and for the screenshots. They confirm the issue, and I will follow up with the team to get a fix in place. For now, binding X to a Float param gets the value through, but it won’t be a proper date until the fix is out.

On your follow-up questions:

Turning off hover but keeping click: that’s not possible at the moment. Disable Mouse Tracking switches off all mouse interaction, clicks included, and there’s no separate setting to hide just the tooltip. If you need a workaround now, you could hide the tooltip with custom CSS targeting .highcharts-tooltip on the chart. We haven’t tested this, so check that it behaves well in your app. We’ll also pass on the request for a separate tooltip toggle.

All series from a stacked bar: the click event only returns the clicked point: its series name, X and Y. To get every series for that bar, use X (the clicked category) in your action to filter the underlying data for that month, then read all the series values from there. That works best once X comes through as a real date, so it depends on the fix above.