projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d916677
)
Fixes from merging repo for two-axes.html and logscale.html.
author
Jeremy Brewer
<jeremy.d.brewer@gmail.com>
Wed, 23 Feb 2011 16:34:44 +0000
(11:34 -0500)
committer
Jeremy Brewer
<jeremy.d.brewer@gmail.com>
Wed, 23 Feb 2011 16:34:44 +0000
(11:34 -0500)
dygraph.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph.js
b/dygraph.js
index
039c6ce
..
f5e19ab
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-1469,6
+1469,9
@@
Dygraph.prototype.mouseMove_ = function(event) {
var canvasx = Dygraph.pageX(event) - Dygraph.findPosX(this.mouseEventElement_);
var points = this.layout_.points;
var canvasx = Dygraph.pageX(event) - Dygraph.findPosX(this.mouseEventElement_);
var points = this.layout_.points;
+ // This prevents JS errors when mousing over the canvas before data loads.
+ if (points === 'undefined') return;
+
var lastx = -1;
var lasty = -1;
var lastx = -1;
var lasty = -1;
@@
-2110,7
+2113,7
@@
Dygraph.numericTicks = function(minV, maxV, self, axis_props, vals) {
var ticks = [];
if (vals) {
for (var i = 0; i < vals.length; i++) {
var ticks = [];
if (vals) {
for (var i = 0; i < vals.length; i++) {
- ticks
[i]
.push({v: vals[i]});
+ ticks.push({v: vals[i]});
}
} else {
if (axis_props && attr("logscale")) {
}
} else {
if (axis_props && attr("logscale")) {
@@
-2224,6
+2227,7
@@
Dygraph.numericTicks = function(minV, maxV, self, axis_props, vals) {
// Add labels to the ticks.
for (var i = 0; i < ticks.length; i++) {
// Add labels to the ticks.
for (var i = 0; i < ticks.length; i++) {
+ if (ticks[i].label !== undefined) continue; // Use current label.
var tickV = ticks[i].v;
var absTickV = Math.abs(tickV);
var label = (formatter !== undefined) ?
var tickV = ticks[i].v;
var absTickV = Math.abs(tickV);
var label = (formatter !== undefined) ?
@@
-2356,7
+2360,7
@@
Dygraph.prototype.drawGraph_ = function() {
// On the log scale, points less than zero do not exist.
// This will create a gap in the chart. Note that this ignores
// connectSeparatedPoints.
// On the log scale, points less than zero do not exist.
// This will create a gap in the chart. Note that this ignores
// connectSeparatedPoints.
- if (point < 0) {
+ if (point <
=
0) {
point = null;
}
series.push([date, point]);
point = null;
}
series.push([date, point]);