From 3f548e2cbc6a224207dcb880d53ecda9e6550fff Mon Sep 17 00:00:00 2001 From: Robert Konigsberg Date: Wed, 1 Jun 2011 15:46:19 -0400 Subject: [PATCH] Better pointClickCallback, updated doc. --- dygraph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dygraph.js b/dygraph.js index e3e8daa..b5e9da6 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1346,7 +1346,7 @@ Dygraph.Interaction.treatMouseOpAsClick = function(g, event, context) { // Allow any click within two pixels of the dot. var radius = g.attr_('highlightCircleSize') + 2; - if (closestDistance <= 5 * 5) { + if (closestDistance <= radius * radius) { g.attr_('pointClickCallback')(event, g.selPoints_[closestIdx]); } } @@ -4064,7 +4064,7 @@ Dygraph.OPTIONS_REFERENCE = // "xValueParser": { "default": "parseFloat() or Date.parse()*", "labels": ["CSV parsing"], - "type": "function(str) -> number", + "type": "function(str[, dygraph]) -> number", "description": "A function which parses x-values (i.e. the dependent series). Must return a number, even when the values are dates. In this case, millis since epoch are used. This is used primarily for parsing CSV data. *=Dygraphs is slightly more accepting in the dates which it will parse. See code for details." }, "stackedGraph": { -- 2.7.4