rendro / easy-pie-chart

easy pie chart is a lightweight plugin to draw simple, animated pie charts for single values
http://rendro.github.io/easy-pie-chart
MIT License
2.07k stars 503 forks source link

Jquery gradient issue #200

Open valeri879 opened 6 years ago

valeri879 commented 6 years ago

How to use gradient on jquery ??

MarioPerini commented 5 years ago

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;
            }
        });
givan2code commented 5 years ago

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

MarioPerini commented 5 years ago

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

givan2code commented 5 years ago

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