easy-pie-chart icon indicating copy to clipboard operation
easy-pie-chart copied to clipboard

Jquery gradient issue

Open valeri879 opened this issue 7 years ago • 4 comments

How to use gradient on jquery ??

valeri879 avatar Nov 11 '17 08:11 valeri879

Dublicate of #198

https://github.com/rendro/easy-pie-chart#using-a-gradient

$(elem).easyPieChart({
            barColor: function() {
                var ctx = this.renderer.getCtx();
                var canvas = this.renderer.getCanvas();
                var gradient = ctx.createLinearGradient(0,0,canvas.width,0);
                gradient.addColorStop(0, "#ffe57e");
                gradient.addColorStop(1, "#de5900");
                return gradient;
            }
        });

MarioPerini avatar Dec 05 '18 17:12 MarioPerini

I'd like to see someone provide a working sample of this 'gradient' because I have yet to get any working examples to render

givan2code avatar Feb 12 '19 14:02 givan2code

https://codepen.io/MarioPerini/pen/exKeJm

MarioPerini avatar Feb 12 '19 15:02 MarioPerini

Thanks for the quick response. Gradients seem to be relatively tricky to position - especially in a dynamic environment. I have been trying to get some kind of 'ranged' display (not my idea) to be flexible.

https://codepen.io/givan2code/pen/rPKwze

givan2code avatar Feb 12 '19 16:02 givan2code