I have a Chart that shows the “decline” of employees based on expiration date. I really would like to be able to have an onclick that displays more information
The input data for the chart is structured like this:
PS C:\Users\reh> $Cache:Contractersdecline
Did you ever find out if any useful information is available with OnClick?
I mean, the data returned is fine but what you would really want is a way to relate the click to an entry/row in UDChartData, for example.
@adam : any idea on this, can we access some information once clicked on the graph? Or maybe I am missing the point of OnClick? If so, can you explain what should be done in the event?
Hmm yeah I would imagine that should include the data point information. I can take a look later. I swear when I implemented this back in the day it did but maybe I’m wrong.
In order of building the chart, the ID property would never shown in the $EventData object.
This will never allow me to e.g. forward to another dynamic page /event/:ID to showe additional information to this event (shown in the chart).
You could use the label to look up your data in your set since it should be unique. The problem with including the whole object is currently, the client-side chart data does not include the entire object and would require some work to serialize the entire object down to the client. The problem with including an entire object is that you are potentially sending a ton of unnecessary data to the client without the user really understanding that it’s happening. The chart really only needs to know about the label and data properties.
UD 2.8
Just had a go at the onclick in a bar chart and get the $EventData returned as a long string.
eg: [{"datasetLabel":"","label":"19.08.4131","borderSkipped":"bottom","backgroundColor":"rgba(123, 33, 12, 0.5019608)","borderColor":"rgba(123, 33, 12, 1)","borderWidth":1,"horizontal":false,"base":336,"x":448.01000022888183,"y":20.299999999999954,"width":118.8,"value":287}]
Should this be an object with properties?