[英]Adding stacklabels to highcharts-ng
I'm trying to add stack labels ( http://api.highcharts.com/highcharts#yAxis.stackLabels ) to my chart 我正在尝试将堆栈标签( http://api.highcharts.com/highcharts#yAxis.stackLabels )添加到我的图表中
http://jsfiddle.net/Hjdnw/970/ http://jsfiddle.net/Hjdnw/970/
According to the docs, https://github.com/pablojim/highcharts-ng all options should go into options object. 根据文档, https://github.com/pablojim/highcharts-ng所有选项都应放入options对象。
$scope.chartConfig = {
options: {
chart: {
type: 'bar'
},
yAxis: {
stackLabels: {
style: {
color: 'black'
},
enabled: true
}
},
},
series: [{
data: [10, 15, 12, 8, 7]
}],
title: {
text: 'Hello'
},
loading: false
}
What am I doing wrong? 我究竟做错了什么?
You just need to add the bar stacking method to plotOptions
, in chartConfig.options
: 您只需要在
chartConfig.options
bar叠加方法添加到plotOptions
中:
plotOptions: {
bar: {
stacking: 'normal'
}
}
When this value is null (or not specified), the stack values are disabled. 当此值为null(或未指定)时,将禁用堆栈值。
Here is a working demo: http://jsfiddle.net/scfy8w53/ 这是一个有效的演示: http : //jsfiddle.net/scfy8w53/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.