diff --git a/src/models/scatter.js b/src/models/scatter.js
index af710a4..c2afdff 100644
--- a/src/models/scatter.js
+++ b/src/models/scatter.js
@@ -167,11 +167,11 @@ nv.models.scatter = function() {
// *Injecting series and point index for reference
/* *Adding a 'jitter' to the points, because there's an issue in d3.geom.voronoi.
*/
- var pX = getX(point,pointIndex) + Math.random() * 1e-7;
- var pY = getY(point,pointIndex) + Math.random() * 1e-7;
+ var pX = getX(point,pointIndex);
+ var pY = getY(point,pointIndex);
- return [x(pX),
- y(pY),
+ return [x(pX)+ Math.random() * 1e-7,
+ y(pY)+ Math.random() * 1e-7,
groupIndex,
pointIndex, point]; //temp hack to add noise untill I think of a better way so there are no duplicates
})
diff --git a/test/ScatterChartTest.html b/test/ScatterChartTest.html
index ae7f2f6..843da37 100644
--- a/test/ScatterChartTest.html
+++ b/test/ScatterChartTest.html
@@ -75,7 +75,10 @@
Scatter chart: duplicate x values
-
+
+ Scatter chart: extremely small data points (1e-10)
+
+
@@ -131,6 +134,8 @@ defaultChartTest("test15",[
}
]);
+defaultChartTest("test16",tinyPoints());
+
function defaultChartTest(container, data, margin) {
nv.addGraph(function() {
var chart;
@@ -219,4 +224,16 @@ function randomDataSloped(slope,intercept) { //# groups,# points per group
return data;
}
+
+
+function tinyPoints() {
+ var rval = {key: "Tiny points", values: []};
+ for(var i =1; i < 20; i++) {
+ rval.values.push({
+ x: Math.random() * 1e-10,
+ y: Math.random() * 1e-10
+ });
+ }
+ return [rval];
+}
diff --git a/test/lineChartTest.html b/test/lineChartTest.html
index 25a7c63..027e633 100644
--- a/test/lineChartTest.html
+++ b/test/lineChartTest.html
@@ -100,6 +100,10 @@
What if there are null, Infinity and NaN values in points?
+
+ Chart with very small, 1e-10, points (old tooltips)
+
+