0

How is it possible to wrap a function in rHighcharts?

For instance, I want to accomplish that the zoom is set to some values when the chart is loaded, with something like this:

a$chart(
    type='line',
    zoomType= 'xy',
    events=list(load=function() {chart.xAxis[0].setExtremes(6, 10);})
)

Is there a standard way how to formulate this and highchart functions in general in R?

Maybe I should brake it down. Lets say I wanted a greeting message after the chart loaded. With the notation from Ramnaths comment, I'd do it like

a$chart(
    type='line',
    zoomType= 'xy',
    events=list(load=!#alert('hello');#!)
)

Is there a way to make this work?

Christian
  • 1,308
  • 3
  • 14
  • 24
  • To pass a function from rCharts to the chart, you need to wrap it in `#! ... !#`. Is that what you were looking for? – Ramnath Oct 18 '13 at 00:43
  • I tried with: events=list(load="#!function() {this.xAxis[0].setExtremes(40, 120);}#!"), but without success. The result should be a javascript code similar to the one described here [link](http://stackoverflow.com/questions/7194249/automatically-zooming-in-on-highcharts-after-loading') – Christian Oct 18 '13 at 10:26

0 Answers0