0

I wish to color the entire area of the graph in different colors using the highcharter package in R. The below code is merely highlighting the dots in the graph not the entire area as illustrated in the picture below The data used here is the favorite_pies data inbuilt in the highcharter package in R.

  hchart('area', hcaes(x = favorite_pies$pie, y = favorite_pies$percent, color = viridis(5))) %>% 
                 hc_colorAxis(stops = color_stops(colors = viridis::inferno(5)))

The current chart

fmarm
  • 4,209
  • 1
  • 17
  • 29
Manasi
  • 179
  • 1
  • 8
  • For an unknown reason, I am not able to run your code (chart is not displayed and I have Highcharts errors in the colsole - #17 and #26. What packages do I actually need except highcharter and viridis? – raf18seb Sep 30 '19 at 08:12
  • @raf18seb you will need to install the 'magrittr' package to use the '%>%' pipe operator in the code. – Manasi Oct 11 '19 at 06:06
  • 1
    Although I figured out how to get the required output. Thanks anyway.. – Manasi Oct 11 '19 at 06:07

0 Answers0