nvd3散点图中的隐形气泡

时间:2014-05-11 06:16:36

标签: javascript d3.js charts nvd3.js

我有这个散点图和示例数据。出于某种原因,我看到不可见/未显示的气泡。 Y轴(在6处)和更多点。我做错了什么或者有些错误吗?

nv.addGraph(function () {

var chart = nv.models.scatterChart()
    .showDistX(true) //showDist, when true, will display those little distribution lines on the axis.
.showDistY(true)
    .transitionDuration(350)
    .color(['#1f77b4'])
    .margin({
    left: 150,
    right: 150
})
    .showLegend(false)
    .sizeRange([50, 5000])
    .interactive(true);

//Configure how the tooltip looks.
chart.tooltipContent(function (key) {
    return '<center><b>Value</b><br><h3>' + key + '</h3></center>';
});


chart.forceY(0)

//Axis settings
chart.xAxis.tickFormat(function (d) {
    return d3.time.format('%b %d')(new Date(d));
});
chart.yAxis.tickFormat(function (d) {
    return d;
});

//We want to show shapes other than circles.
chart.scatter.onlyCircles(true);

d3.select('#categories-viewed-scatterchart svg')
    .datum(data)
    .call(chart);

nv.utils.windowResize(chart.update);

return chart;
});

Jsfiddle:http://jsfiddle.net/eyedagger/4Dm9D/

1 个答案:

答案 0 :(得分:0)

事实证明,我存储数据的方式是个问题。我有一个每个数据集的密钥,我应该有一组数据集的唯一键。

看起来如果密钥重复,就会出现问题。

相关问题