.easyPieChart in Meteor

Hi, do somebody know, how to make works “easyPieChart”? Please take a look if there is smt wrong in my code. I dont understand why is not working.

thanks a lot for your help!

Maria

Template.myskills.onRendered(function() {
$('.chart').easyPieChart({
    scaleColor: "#ecf0f1",
    lineWidth: 20,
    lineCap: 'butt',
    barColor: '#1abc9c',
    trackColor: "#ecf0f1",
    size: 160,
    animate: 500
});

});

    <template name="myskills">
    <h1>Flat Skills charts with "Easy Pie chart"</h1>
    <div class="chart" data-percent="80">HTML5</div>
    <div class="chart" data-percent="30">CSS3</div>
    <div class="chart" data-percent="60">SASS</div>
    <div class="chart" data-percent="50">jQuery</div>
    <div class="chart" data-percent="11">AngularJS</div>
    <div class="chart" data-percent="20">BackboneJS</div>
    <div class="chart" data-percent="30">NodeJS</div>
    <div class="chart" data-percent="60">PHP</div>

Hard to tell without the error message. Could you post it?

Is it just a typo or haven’t you closed the template-Tag in your code (?

Hi, I have closed template tag. I just copied it here wrong.

here is an error msg: typeError: $(…).easyPieChart is not a function

In which way have you included the easyPieChart-Library?

It seems that the library is not loaded correctly.

I didn’t include any easyPieChart-Library. How I do it?

There are different ways.
You could add the files by hand, load externally (e.g. from a CDN) or use a package.

I would recommend the package-Way.

Just use this package (run meteor add meteor add rendro:easy-pie-chart in your terminal)

https://atmospherejs.com/rendro/easy-pie-chart

and it should work.

1 Like

yes it’s working, Thanks a lot!
I thought when it’s js function it should work in meteor without package.