0

I am struggling in adding one level drilldown in my grouped column chart made using highcharter. To explain, I am taking using the "vaccines" dataset available in highcharter library :

My code (similar) that creates the grouped column chart :

library (highcharter)
library(dplyr)

df <- na.omit(vaccines[vaccines$year %in% c("1928", "1929"),])
df <- ddply(df, c("state", "year"), summarise, count = sum(count))
hc <- hchart(df, type = "column", hcaes(x = state, y = count, group = year)) %>% 
  hc_xAxis(title = list(text = "States")) %>% 
  hc_yAxis(title = list(text = "Vaccines")) %>% 
  hc_chart(type = "Vaccines", options3d = list(enabled = TRUE, beta = 0, alpha = 0)) %>% 
  hc_title(text = "Demo Example") %>% 
  hc_subtitle(text = "Click on the on Year to see the Vaccine drill down")
hc

It creates this grouped chart perfectly It creates this grouped chart perfectly

I now want to add one level drill down to the chart where I can select the "Year" and corresponding drill down data of the vaccine selected is presented. Can you please help with the best/easiest way to do it considering I have the individual drill down data also in data frames.

Regards, Nikhil

Bea
  • 1,110
  • 12
  • 20
  • http://jsfiddle.net/gh/get/jquery/2/highcharts/highcharts/tree/master/samples/highcharts/drilldown/multi-series/ This is what I want to achieve - drill down on individual groups. – nikhil choudhry May 22 '17 at 16:48
  • This should get you where you need to go! It is not difficult, just watch your syntax! https://stackoverflow.com/questions/38192825/how-to-make-3-levels-drilldown-plot-in-r-highcharter-possible-other-packages/38203695#38203695 – sconfluentus May 22 '17 at 20:26
  • Can you help me with an example where the grouped chart is made using hchart command? How can we then add the first level drill down considering the data here is dynamic i.e I don't know what will be the id's therefore I can not predefine the id and data syntax of hc_drilldown command for all the grouped columns from my chart. – nikhil choudhry May 23 '17 at 00:50
  • I don't have one personally. – sconfluentus May 23 '17 at 01:08
  • Are you trying to create multiple level drilldown? http://jsfiddle.net/kaushalpatel922/z8g759s7/8/ Check year 2016 only! – PKA May 26 '17 at 17:25
  • Thanks Kaushal, Yes I am trying for multi-level drill down but I wanted to understand if the R Highcharter library function (hcchart) allows to add drill down series. I am able to do it with a hack though.. – nikhil choudhry Jun 09 '17 at 08:01

0 Answers0