Highcharts垂直堆叠条形图与负值,是可能吗? [英] Highcharts vertical stacked bar chart with negative values, is it possible?

查看:334
本文介绍了Highcharts垂直堆叠条形图与负值,是可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用带负值的垂直堆叠条形图(使用highcharts)。

Is it at all possible to be able to have a vertically stacked bar chart with negative values (using highcharts).

像这样:
http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/column-stacked/

        series: [{
            name: 'John',
            data: [5, -3, 4, 7, 2]
        }, {
            name: 'Jane',
            data: [2, 2, -31, 2, 1]
        }, {
            name: 'Joe',
            data: [3, 4, 4, 2, 5]
        }]


$ b b

不幸的是负值没有注册。

Unfortunately negative values don't register.

这似乎是一个解决方案:
http://jsfiddle.net/ gh / get / jquery / 1.9.1 / highslide-software / highcharts.com / tree / master / samples / highcharts / demo / bar-negative-stack /

This seems to be a solution: http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/bar-negative-stack/

但是出于视觉的原因,我需要垂直的酒吧。

But for visual reasons I need the bars to be vertical.

非常感谢任何解决方案。

Any thoughts on a fix would be greatly appreciated!

感谢,

汤姆

推荐答案

试图实现相同的结果。检查这个小提琴,让我知道=]
我使用:

I was trying to achieve the same results. Check this fiddle and let me know =] I used:

chart: {
    type: 'column'
},
plotOptions: {
    series: {
        stacking: 'normal'
    }
}

jsfiddle垂直堆叠条纹w negatives

编辑:尝试将类型更改为bar。这将使图表列横向=]

try changing the type to 'bar'. This will make the chart "columns" go horizontal =]

jsFiddle for horizo​​ntal stacked bars w negatives

这篇关于Highcharts垂直堆叠条形图与负值,是可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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