HighCharts堆栈总数位于堆叠百分比的顶部 [英] HighCharts stack totals on top for percent stacking

查看:85
本文介绍了HighCharts堆栈总数位于堆叠百分比的顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在显示堆积的百分比柱形图。我希望总数显示在最上面。我向YAxis添加了以下内容:

  stackLabels:{
enabled:true,//这被忽略<< <<<<
style:{
fontWeight:'bold',
color:(Highcharts.theme&& amp; Highcharts.theme.textColor)|| 'grey'
}
}

但是这只适用于叠加不是百分比。我怎样才能达到我想要的效果(在堆积列之上显示总数?)



可以在以下位置检查代码: http://jsfiddle.net/Bzs2k/1/

解决方案 stackLabels 选项正在工作,但是没有足够的空间容纳标签顶部的标签。将此添加到yAxis以填充一些空间:

  yAxis:{
最小值:0,
最大值:105,
endOnTick:false ,
等...

已更新小提琴 here


I'm displaying a stacked percent column chart. I want the total to be displayed on top. I added following to YAxis:

stackLabels: {
    enabled: true, // This is ignored <<<<<<
    style: {
      fontWeight: 'bold',
      color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
    }
}

But this works only if the stacking is not "percent". How can I achieve what I want (showing total on top of the stacked column?

The code can be checked at : http://jsfiddle.net/Bzs2k/1/

解决方案

Actually the stackLabels option is working, but there is not enough room for the labels at the top of the plot. Add this to the yAxis to pad some space:

yAxis: {
    min: 0,
    max: 105,
    endOnTick: false,
    etc...

Updated fiddle here.

这篇关于HighCharts堆栈总数位于堆叠百分比的顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆