0

我正在使用 nvd3 图表库在我们的应用程序中显示报告。我使用了带有 nvd3 图表库中取景器类型图表的 Line。在折线图中,我们找到了用于过滤目的的第二个轴(X 和 Y)。可以你请告诉我如何隐藏第二轴?

如下图所示

4

2 回答 2

0

没有选择,但您可以通过对src/models/lineWithFocusChart.js.

comment out the following lines (I suppose you're using the newest version of nvd3 1.1.10 beta)

L300-303

    g.select('.nv-context .nv-x.nv-axis')
          .attr('transform', 'translate(0,' + y2.range()[0] + ')');
    d3.transition(g.select('.nv-context .nv-x.nv-axis'))
          .call(x2Axis);

L311-315

    d3.transition(g.select('.nv-context .nv-y.nv-axis'))
      .call(y2Axis);

    g.select('.nv-context .nv-x.nv-axis')
      .attr('transform', 'translate(0,' + y2.range()[0] + ')');

应该可以工作,但没有经过全面测试。

于 2013-08-28T14:44:32.837 回答
0

嘿,我想您想要实现的似乎是一个简单的折线图,您可以使用示例中给出的它而不是带有 View Axis 的 Line

让我知道我是否错误地理解了您的问题。

于 2014-01-22T09:41:58.240 回答