javascript - Highcharter - move data label to top of column -
i move data labels, centered on columns default, of waterfall chart above each column. looking through highcharts options found overflow option , so post on how move data labels highcharts (not highcharter though).
however, implementing proposed steps of setting crop = false , overflow = 'none' did not move data labels.
here small example proposed settings:
library(highcharter) dataframe <- data.frame(name = c("a","b","c", "d"), y = c(12.10, 5.45, -8.60, na), isintermediatesum = c(false, false, false, false), issum = c(false, false, false, true), color = c("#377eb8", "#4daf4a", "#e41a1c", "#377eb8"), stringsasfactors = f) data_list = dataframe %>% list_parse() highchart() %>% hc_chart(type = "waterfall") %>% hc_title(text = "") %>% hc_subtitle(text = "") %>% hc_xaxis(type = 'category') %>% hc_yaxis( title = list(text = ""), labels = list(format = "{value:,.2f}%", usehtml = true) ) %>% hc_legend(enabled=false) %>% hc_tooltip(pointformat = '<b>{point.y:,.2f}%</b>', usehtml = true) %>% hc_add_series(data = data_list, datalabels = list( enabled=true, formatter= js("function(){ return highcharts.numberformat(this.y, 2, ',') + '%';}"), style=list( color="#ffffff", fontweight="bold", textshadow="0px 0px 3px black" ), crop = false, overflow = 'none' ) ) does of know how move data labels?
if understood u correctly
verticalalign: stringsince 2.3.3 vertical alignment of data label. can 1 of top, middle or bottom. default value depends on data, instance in column chart, label above positive values , below negative values.
datalabels: {verticalalign: 'top'} js fiddle: http://jsfiddle.net/obrylg6q/
new fiddle: http://jsfiddle.net/obrylg6q/1/
crop: false, overflow: 'none', x: 0, y: -30, // above bar or
set datalabels.inside false: jsfiddle.net/obrylg6q/2 – grzegorz blachliĆski 18 mins ago
highcharts developer comment. think should follow advice)
crop: false, overflow: 'none', inside: false
Comments
Post a Comment