kismsu
kismsu

Reputation: 1099

How to use Highcharts theme with rCharts

I want to create my own theme for Highcharts to use them with rCharts on Shiny app. I've tried to add link to theme scrip by adding tags$head( tags$script(type="text/javascript", src = "js/themes/gray.js") )

to ui.r. However this doesn't work. Should I call theme directly from rCharts function?

Upvotes: 0

Views: 598

Answers (1)

jdharrison
jdharrison

Reputation: 30455

You need to have the required script in your app directory:

You can put it directly in your app directory and use includeScript("gray.js") or place it in the www folder and use tags$head( tags$script(type="text/javascript", src = "gray.js") ). The scripts can be found on the highcharts github page https://github.com/highslide-software/highcharts.com/blob/master/js/themes/gray.js . I have included an example https://gist.github.com/johndharrison/bc1440afad69433f5e61 . You can run it by calling:

runGist("bc1440afad69433f5e61")

enter image description here

Upvotes: 2

Related Questions