nvd3 多图表 Y 轴不在同一条线上

问题描述

我试图在 nvd3 上比较不同的日期范围和不同系列的多图表。我面临的问题是,当光标悬停在一些刻度上时。需要比较的 Y 轴不在同一个刻度上,并且工具提示的行为很奇怪。但是,没有收到任何错误或异常抛出。您可以在下面找到图表示例图片和相关代码

const tickValues = val.series[0].values.map((o,i)=>o.x/1000);  // something like["0.10","0.20"] etc.
            nv.addGraph(() => {
                var height = 300;
                var chart = nv.models.multiChart().legendRightAxisHint("").useInteractiveGuideline(true).showLegend(false).height(height);
                chart.options({
                    hideY2:true
                });
                chart.xAxis.axisLabel('Date').tickValues(tickValues).tickFormat(function(d) {
                    return d3.time.format('%x')(new Date(d))
                });
                chart.yAxis1.axisLabel('Orders').tickFormat(d3.format('.02f'));
                chart.yAxis2.tickFormat(d3.format('.02f'));
                //              chart.yAxis2.tickFormat(d3.format('.02f'));
                this.redraw(chart)
                this.chartRef = chart
            });

documentation

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...