Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Adding right click ability as well as ability to specify an array of tick colors #39

Open
wants to merge 2 commits into from

1 participant

This page is out of date. Refresh to see the latest.
Showing with 16 additions and 2 deletions.
  1. +16 −2 jquery.flot.js
View
18 jquery.flot.js
@@ -800,6 +800,9 @@
if (options.grid.clickable)
eventHolder.click(onClick);
+ if (options.grid.rightclickable)
+ eventHolder.rightClick(onRightClick);
+
executeHooks(hooks.bindEvents, [eventHolder]);
}
@@ -810,6 +813,7 @@
eventHolder.unbind("mousemove", onMouseMove);
eventHolder.unbind("mouseleave", onMouseLeave);
eventHolder.unbind("click", onClick);
+ eventHolder.unbind("rightClick", onRightClick);
executeHooks(hooks.shutdown, [eventHolder]);
}
@@ -1630,8 +1634,12 @@
}
// draw ticks
- ctx.beginPath();
for (i = 0; i < axis.ticks.length; ++i) {
+ ctx.beginPath();
+ if( axis.options.tickColorArray ) {
+ ctx.strokeStyle = axis.options.tickColorArray[ i % axis.options.tickColorArray.length ];
+ }
+
var v = axis.ticks[i].v;
xoff = yoff = 0;
@@ -1666,9 +1674,9 @@
ctx.moveTo(x, y);
ctx.lineTo(x + xoff, y + yoff);
+ ctx.stroke();
}
- ctx.stroke();
}
@@ -2397,6 +2405,12 @@
triggerClickHoverEvent("plotclick", e,
function (s) { return s["clickable"] != false; });
}
+
+ function onRightClick(e) {
+ triggerClickHoverEvent("plotrightclick", e,
+ function (s) { return s["rightclickable"] != false; });
+ }
+
// trigger click or hover event (they send the same parameters
// so we share their code)
Something went wrong with that request. Please try again.