From a286f044ef041523fb5df6b1ce9dd5b2b11690ca Mon Sep 17 00:00:00 2001 From: David Schnur Date: Mon, 22 Jul 2013 13:50:18 -0400 Subject: [PATCH] Draw bars using fillRect instead of paths. This is up to 2x faster and appears to work around issues in Chrome's canvas implementation that sometimes result in bars not being filled. Resolves #915. --- jquery.flot.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/jquery.flot.js b/jquery.flot.js index a1c97f5..63d9043 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -2544,13 +2544,8 @@ Licensed under the MIT license. // fill the bar if (fillStyleCallback) { - c.beginPath(); - c.moveTo(left, bottom); - c.lineTo(left, top); - c.lineTo(right, top); - c.lineTo(right, bottom); c.fillStyle = fillStyleCallback(bottom, top); - c.fill(); + c.fillRect(left, top, right - left, bottom - top) } // draw outline