Give the chart region a static id, then you can use this to get the chart object:
Where "chart1" is the static id, and "chart1_chart" is an element being created in the region. Thus, just concatenate your static id with "_chart". "object" will select the anychart object element.
Excellent I can go further now but hit another problem.
I set the id of the chart region to p41chart, and I checked then page source an I saw that it had a id="p41chart_chart" so I am on the right track.
I created a button which is running a Dynamic Action.
In the dynamic action attached to this button a write this code
var chart=AnyChart.getChartById($("#p41chart_chart object"));
On Selection Type of Dynamic Action I set DOM Object with value p41chart_chart
When I press the button I am gettingTypeError: chart is null in chart.addEventListener('pointClick', onPointClick);I read that getChartById had to be called after the OnDraw of the chart but since I call this from a button the chart is fully rendered when I press the Button, however chart still comes back as null.Any ideas for me to try.Thank youCarlos
Ah sorry, I forgot something (Copy-paste blundering). The point of giving the region a static id is indeed to retrieve the object element, though not to get the anychart object with it. The getChartById expects the id of the object element, not that element itself. So:
And that'll correctly fetch you the AnyChart object!