有没有办法在lineWithFocusChart上添加多个轴。
我想在图的右侧添加我的y2axis。
发布于 2016-05-02 23:47:25
在NVD3库中有一个用于绘制多轴图表的默认选项。只需查看the documentation website of the library上的multichart示例。nvd3的github存储库提供了a sample html file
您可以使用柱状图,Areachart和多轴折线图。
只需使用以下命令绘制图形
var chart = nv.models.multiChart()
并更改yAxis变量以在左侧yaxis或右侧yaxis上绘制图形,如下所示。
testdata[0].type = "area";
testdata[0].yAxis = 1;
testdata[1].type = "area";
testdata[1].yAxis = 1;
testdata[2].type = "line";
testdata[2].yAxis = 1;
testdata[3].type = "line";
testdata[3].yAxis = 2;
testdata[4].type = "bar";
testdata[4].yAxis = 2;
testdata[5].type = "bar";
testdata[5].yAxis = 2;
testdata[6].type = "bar";
testdata[6].yAxis = 2;
https://stackoverflow.com/questions/36937569
复制相似问题