I'm using a button to run a script when the button is clicked in a Perspective view. I make a selection on an XY Chart and then click the button. The button uses the 'onActionPerformed' event to run a script that calls a second script that runs on the XY Chart. This is the script on the button:
self.parent.getChild('XYChart_1').getTableData()
This works the first time I click the button, but the script does not rerun with subsequent clicks. This happens in preview mode and when running the project in browser. Any ideas on how to fix this?
I found that this is actually not an issue with the button, the selection on the XY Chart doesn't change when a new point is selected. If anyone knows how to fix this, that would be greatly appreciated.
Final update: this appears to have been caused by not naming the labels in my XY Chart data.
Old data format:
New data format:
With the old data format, I was able to make an initial selection. If I clicked any other bullet on the graph, the selection would not change. However, I could click the initially selected point, which would clear props.selection.data. After this I could select a new point and repeat. With the new data format, selection functions as expected (selecting a new point changes props.selection.data).
1 Like