简体   繁体   English

需要在Highcharts中创建此图

[英]Need to create this graph in Highcharts

Graph with two series label 具有两个系列标签的图

The main challenge I'm facing is placing two series labels. 我面临的主要挑战是放置两个系列标签。 The graph is constructed based on the values within brackets (Eg. (10.3)). 该图是根据方括号内的值构建的(例如(10.3))。 But I need to show another value on top each columns. 但是我需要在每列顶部显示另一个值。 how can I achieve this. 我怎样才能做到这一点。

PS: I can't alter the design. PS:我无法更改设计。

Add your another value array as a series ,make it visible false either on chart load or via visible:false in series array. 将另一个值数组添加为一个序列,使其在图表加载时或在序列数组中通过visible:false变为false。 Then use stacklabel and get this extra series's values using formatter function, So it won't should you series total but instead desired value. 然后使用stacklabel并使用格式化程序功能获取此额外系列的值,因此您不应该对总数进行系列化,而应该对期望值进行系列化。

  stackLabels: { 
                enabled: true,
                formatter: function() {                       
                    return (this.axis.series[1].yData[this.x] ) ;

                }
            }

See working Demo here 在这里查看工作演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM