Skip to content

Instantly share code, notes, and snippets.

@ArtemGr
Created January 23, 2009 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArtemGr/51009 to your computer and use it in GitHub Desktop.
Save ArtemGr/51009 to your computer and use it in GitHub Desktop.
Enable optional transparency in PlotKit
[artemgr@pcbsd /tmp/plotkit-patches]$ git diff
diff --git a/PlotKit/SweetCanvas.js b/PlotKit/SweetCanvas.js
index dcfdfc5..39cbf2c 100644
--- a/PlotKit/SweetCanvas.js
+++ b/PlotKit/SweetCanvas.js
@@ -195,6 +195,10 @@ PlotKit.SweetCanvasRenderer.prototype._renderLineChart = function() {
// faux shadow for firefox
if (this.options.shouldFill) {
+ // Transparent fill.
+ // See "http://groups.google.com/group/plotkit/browse_frm/thread/8e86898adce15bd7".
+ if (this.options.globalAlpha) context.globalAlpha = this.options.globalAlpha;
+
context.save();
if (this.isIE) {
context.fillStyle = "#cccccc";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment