如何使用HighChart中的多个yAxis在两个系列之间填充区域? [英] How to fill the Area between two series with multiples yAxis in HighChart?
问题描述
arearange
'系列(添加带有区域范围的虚拟系列以添加填充颜色)或使用堆叠区域(使用虚拟区域系列与 stacking:true
,在实际系列下透明,然后用所需颜色添加另一个堆叠区域)。 可以在这里看到一个例子。 但是我的问题非常具体:我需要填充两个系列之间的区域,这些区域不共享相同的yAxis,因此我无法添加虚拟系列,因为我无法确定要使用哪个yAxis。
(同样的问题发生在系列不共享相同的xAxis参考值时, JSFiddle示例
我该怎么做?
您可以使用相同的两个连接轴(相同的范围/滴答)数据,然后使用区域范围类型的其他系列: http://www.highcharts.com/demo/arearange
The topic of filling area between series has been discussed quite a lot. I've seen some solutions using 'arearange
' series ( adding dummy serie with area range to add the fill color ) or using 'stacked area' ( using dummy area serie with stacking: true
, transparent under the actual series, then add another stacked area with the needed color ). An example can be seen here.
but my problem is quite specific : I need to fill the area between to series which don't share the same yAxis, thus I can't add a dummy serie since I can't figure which of the yAxis to use.
( The same problem occurs when series don't share the same xAxis reference values, as seen in this example )
For example, let's say I want to fill the area on this chart where the blue 'rainfall' line is under the green 'temperature' line : JSFiddle example
How can I do that ?
You can use the same two linked axis (the same ranges /ticks) but with different data, and then use additional series with arearange type: http://www.highcharts.com/demo/arearange
这篇关于如何使用HighChart中的多个yAxis在两个系列之间填充区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!