nvd3流图将随时间急剧下降或上升。我搜索了SO和NVD3文档,但没有找到控制每个时间点y轴零位置的变量。我也没有找到对此的讨论。换句话说,是什么使整个图形在一个方向或另一个方向倾斜,以及如何控制或关闭该倾斜。
我阅读了拜伦关于流线图的一些初始论文,但无法弄清楚,以为我会在这里问。
Could someone please point me towards documentation on this or otherwise provide insight?
The NVD3 code for the stacked area chart accepts four possibilities for the chart style: stack, stream, stream-center, and expand. The default stream graph is the "stream" style, and this is the version that gets off-centre if you have any zero values in your data.
If you set the style explicitly to "stream-center", the chart behaves as expected. However, the radio buttons that switch between display styles switch back to the problematic algorithm, so they will need to be disabled.
chart.style('stream-center')
.showControls(false);
It's possible that the existence of this other display algorithm means that the NVD3 folks are working on it. The github issue page might be a good place to look for updates or responses from them:
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句