highcharts datatable - function parameters

622 Views Asked by At

I want to display a datatable below my highcharts graphs. I found on the Highcharts FAQ a running example.

Highcharts.drawTable = function() {...}

I need to display many datatables, so i want to refactor my code in order to be able to give display parameters to the Highcharts.drawTable function. (this avoid many code duplication !)

I try to add arguments to the Highcharts.drawtable function, and give value on the function call. But I got an error

chart.xAxis isn't defined

Live example on jsfiddle

Could you, please, help me in order to give parameters to the Highcharts.drawtable function ?

1

There are 1 best solutions below

0
On BEST ANSWER

Call drawTable function in load function, instead of reference.

load: function(){
            Highcharts.drawTable(this, 310, 100, 0, '', 20, 20, 2.5)
}

Example: http://jsfiddle.net/z9zXM/1035/