我正在使用nvd3.js顯示帶有3個不同鍵的圖形。在那些3,1中有很多的座標,其餘的2個只有一個座標。現在這些單一座標不能正確顯示。我的代碼是這樣的:點在nvd3 ghaph中不能清晰可見
nv.addGraph(function() {
var chart = nv.models.lineChart().margin({
top: 30,
right: 20,
bottom: 50,
left: 45
}).showLegend(true).tooltipContent(function (key, y, e, graph) {
return '<h3>' + key + '</h3>' + '<p>' + e + '% at ' + y + '</p>'
});
chart.xAxis.tickFormat(function (d) {
return d3.time.format('%x')(new Date(d))
});
d3.select('#lineChart svg')
.datum(data)
.transition().duration(500)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
data = [{
"values": [{
"x": 1025409600000 ,
"y": 2
}, {
"x": 1028088000000 ,
"y": 4
}, {
"x": 1030766400000 ,
"y": 1
}, {
"x": 1033358400000 ,
"y": 3
}, {
"x": 1036040400000 ,
"y": 0
}, {
"x": 1038632400000 ,
"y": 3
}],
"key": "Cool"
},{
"values": [{
"x": 1025409600000 ,
"y": 2
}],
"key":hot
}
]
原以爲hot
點出如果我鼠標光標,但它是不可見的位置。 請指導我如何使它可見,如果鑰匙只有一個座標。 在此先感謝。
更新了圖片
,你可以請你的輸出圖像 –
請檢查更新的圖像。 – Mausumi