diff --git a/LICENSE b/LICENSE index 6ca5d99..c85f5e5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,8 @@ The MIT License (MIT) -Copyright (c) 2015 Alexander Wunschik +Copyright (c) 2010, 2011, 2012, 2013 by Juergen Marsch +Copyright (c) 2015 by Alexander Wunschik +Copyright (c) 2015 by Stefan Siegl Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 6dc4d2d..394279a 100644 --- a/README.md +++ b/README.md @@ -104,3 +104,7 @@ Licensed under [MIT](http://opensource.org/licenses/MIT) ### 0.3.2 * code cleanup + +### 0.3.3 +* `series.color` can be of type `function` (thx @stesie) + diff --git a/example/index.html b/example/index.html index d260bd4..50fcfa7 100644 --- a/example/index.html +++ b/example/index.html @@ -26,7 +26,10 @@ var d2 = [[60,25,15], [70,40,6], [30,80,4]]; var options = { series: { - color: '#CCC', + color: function(x, y, value) { + var red = 155 + value * 10; + return 'rgba('+red+',200,200,1)'; + }, bubbles: { active: true, show: true, diff --git a/jquery.flot.bubbles.js b/jquery.flot.bubbles.js index 2e79043..7c4c4a1 100644 --- a/jquery.flot.bubbles.js +++ b/jquery.flot.bubbles.js @@ -2,6 +2,7 @@ * The MIT License Copyright (c) 2010, 2011, 2012, 2013 by Juergen Marsch +Copyright (c) 2015 by Stefan Siegl Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -25,7 +26,7 @@ THE SOFTWARE. "use strict"; var pluginName = "bubbles"; - var pluginVersion = "0.3.2"; + var pluginVersion = "0.3.3"; var options = { series: { @@ -134,6 +135,9 @@ THE SOFTWARE. y = offset.top + serie.yaxis.p2c(data[1]); v = data[2]; r = parseInt(serie.yaxis.scale * data[2] / 2, 0); + if(typeof c === 'function') { + c = c.apply(this, data); + } serie.bubbles.drawbubble(ctx, serie, x, y, v, r, c, overlay); };