Hi Simon,
I was doing similar recently and made an example dashboard as a reference, attached in GG-Click-ViewState-Test.json
Its a very simple example with an Analyst Visual Plot and a Data Grid.
Clicking a point on the Analyst Visual Plot populates the Data Grid with details of the clicked point.
Note: Enabling passing a viewstate depends on using .qp.s.onclick in your GoG code, details on that here: https://code.kx.com/developer/libraries/grammar-of-graphics-layer-settings/#qpsonclick
Some quick notes I made as reference when getting the click + view state functionality to work. Also found as comments in the dashboard:
// NOTES: // - .qp.s.onclick is used to select the row of data based on the point that is clicked. // - In dashboards we need a dictionary with two keys: // 1. `viewstate - This is what we use to pass values into our "Selected Viewstate". NOTE: Must be of type list. // 2. `tooltip - This is the values used in the tooltip when you click a point. Passing x as the value for this ensures you produce the full row of data in the tooltip
Any questions let me know.
Cheers,
Kevin