Getting query information for already created visual


#1

Hi community, I have a demo data application already created and in a certain point in time I need get programatically the query information that was used to create the chart, how can I do that, thanks.


#2

Hi @pedro you should take a look at the article Re-using Visualizations on the documentation because to obtain the information of the query that was used to create the chart, the first thing you need to do is recover a reference to the visualization, if you don’t have it already, for example:

var myChart = cf.getVisualization(‘element_id’);

Then you can get the query iformation in this way:

myChart.getAQLConfig(myChart._currentAQL);

Let me know if this is what you are looking for. Best regards.


#3

Or you could better use the following shortcut with the same results:

myChart.get('aql')

We are plannig to include the documentation for this part of the API soon.


#5

Thank you guys both ways works…