Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

highcharter: how can I customize the labels on a column plot

$
0
0

I am trying to make a highcharts plot similar to this (made with ggplot): enter image description here

This code comes close, but I am uncertain how to change the label to indicate the games rather than the win_rate.

data = data.frame(player = c('Edwin', 'Ahmad', 'Sonia', 'Jessica'),
                  games = c(10, 20, 15, 40),
                  win_rate = c(.5, .2, .8, .4))




highchart() %>%
      highcharter::hc_chart(type = 'column', zoomType = 'x') %>%
      highcharter::hc_plotOptions(column = list(stacking = 'normal'))  %>%
      highcharter::hc_xAxis(categories = data$player) %>%
      highcharter::hc_add_series(name = 'Win Rate', 
                                 data = data$win_rate,  
                                 dataLabels = list(enabled = TRUE, verticalAlign = 'top'))

How can I swap out the default labels with labels of my own choosing?


Viewing all articles
Browse latest Browse all 201867

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>