简体   繁体   English

在堆叠的列范围图中显示重叠范围,而不是重叠

[英]Display overlapping ranges in columnrange chart stacked instead of overlapping

I need to generate columnrange charts with categories on the Y axis and datetime on the X axis. 我需要生成在Y轴上具有类别,在X轴上具有日期时间的列范围图表。 There are multiple ranges per category. 每个类别有多个范围。 Sometimes, two ranges overlap in the same category, like this: 有时,两个范围在同一类别中重叠,如下所示:

data: [
    [0, Date.parse('Sun, 17 Jan 2016 16:00:00 GMT'), Date.parse('Sun, 17 Jan 2016 17:00:00 GMT')],
    [0, Date.parse('Sun, 17 Jan 2016 16:30:00 GMT'), Date.parse('Sun, 17 Jan 2016 17:30:00 GMT')]
]

As you can see, one range goes from 16:00 to 17:00, and the other goes from 16:30 to 17:30, in the same category. 如您所见,在同一类别中,一个范围从16:00到17:00,另一个范围从16:30到17:30。 Currently, these get rendered overlapped: https://jsfiddle.net/felixfbecker/18mst6dj/3/ 当前,这些渲染重叠: https : //jsfiddle.net/felixfbecker/18mst6dj/3/ 图表

I need those to display more like this (quick Illustrator mockup): 我需要那些来显示更多这样的内容(快速Illustrator样机):

图1

So they dont get overlapped but are shown stacked, but still in the same category. 因此它们不会重叠,而是显示为堆叠,但仍处于同一类别中。 Is there any way to achieve this (preferably in Highcharts, if not, maybe in some other charting library)? 有什么方法可以做到这一点(最好是在Highcharts中,如果没有,最好是在其他图表库中)?

I found the answer in the forums: http://forum.highcharts.com/post120037.html 我在论坛上找到了答案: http : //forum.highcharts.com/post120037.html

tl;dr you have to add them to a new series, but can link the two series with linkedTo so they only show up once in the legend. tl; dr,您必须将它们添加到新系列中,但可以将两个系列与linkedTo链接起来,因此它们在图例中仅显示一次。

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

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