How To Get Chart Series data on Button click?

Hi All,

When i click on button then i have need to get chart.series as well as other attribute like chartObj.xAxis, yAxis:chartObj.yAxis etc.

Using before render snippet i am able to get this information using below code:

var chartObj = arguments[0], $ = skuid.$;
console.log(chartObj.xAxis);
console.log(chartObj.yAxis);
console.log(chartObj.seriesxAxis);

But using on click button snippet how can i get this xAxis, yAxis and series data from a chart?
I have assigned a uniquie to chat as “ChartEXG”:
Then using that code in snippet for button click  :skuid.$C(‘ChartEXG’).series

But not able get series data.

Can anyone please let me know how i can get chart series and other attribute data on button click.

Thanks,
Raj

Hey Raj!

Thanks for your question -

You’re pretty close - in order to grab the chart object similar to what you’re getting in the “Before Render” snippet, you’re going to have use the function getHCConfig() on click.  This will return the xAxis, yAxis, and series parameters.  Essentially, you want to use the following snippet on button click:

var chart = skuid.$C('ChartEXG').getHCConfig(); console.log(chart.xAxis); console.log(chart.yAxis); console.log(chart.series);

Hope this helps!
Christine

@Christine Thank you for your quick reply on this.

Yes that worked and i am able to get the series, xAxis information from chart.

Thanks for this post!

Christine, do you know if it’s possible to redraw a chart using a button action?

http://api.highcharts.com/highstock/Chart.redraw

Thanks!
Josh

Josh - you can use the following to redraw a chart:

skuid.$C('CHART_NAME').draw()

You can create a one-line snippet which you can call on a button action.

Thanks Christine!

Is there somewhere that I can find the commands available via the skuid. syntax for highcharts?