From e672c50a1376c7495de9385248ac9773d6654017 Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Wed, 21 Oct 2009 18:04:13 +0000 Subject: [PATCH] Added option for setting line width to crosshairs plugins (patch by Phrogz) git-svn-id: https://flot.googlecode.com/svn/trunk@214 1e0a6537-2640-0410-bfb7-f154510ff394 --- jquery.flot.crosshair.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jquery.flot.crosshair.js b/jquery.flot.crosshair.js index 30f338e..a5f9286 100644 --- a/jquery.flot.crosshair.js +++ b/jquery.flot.crosshair.js @@ -5,12 +5,14 @@ over the plot. crosshair: { mode: null or "x" or "y" or "xy" color: color + lineWidth: number } Set the mode to one of "x", "y" or "xy". The "x" mode enables a vertical crosshair that lets you trace the values on the x axis, "y" enables a horizontal crosshair and "xy" enables them both. "color" is -the color of the crosshair (default is "rgba(170, 0, 0, 0.80)") +the color of the crosshair (default is "rgba(170, 0, 0, 0.80)"), +"lineWidth" is the width of the drawn lines (default is 1). The plugin also adds two public methods: @@ -32,7 +34,8 @@ The plugin also adds two public methods: var options = { crosshair: { mode: null, // one of null, "x", "y" or "xy", - color: "rgba(170, 0, 0, 0.80)" + color: "rgba(170, 0, 0, 0.80)", + lineWidth: 1 } }; @@ -90,7 +93,7 @@ The plugin also adds two public methods: if (crosshair.x != -1) { ctx.strokeStyle = c.color; - ctx.lineWidth = 1; + ctx.lineWidth = c.lineWidth; ctx.lineJoin = "round"; ctx.beginPath();