Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
21627 kshitij.so 1
$(document).ready(function() {
2
 
3
    // easy pie chart
4
    $('.percentage').easyPieChart({
5
        animate: 1000,
6
        size: 135,
7
        barColor:'#FF2D55'
8
    });
9
    $('.percentage-light').easyPieChart({
10
        barColor: function(percent) {
11
            percent /= 100;
12
            return "rgb(" + Math.round(255 * (1-percent)) + ", " + Math.round(255 * percent) + ", 0)";
13
        },
14
        trackColor: '#666',
15
        scaleColor: false,
16
        lineCap: 'butt',
17
        lineWidth: 15,
18
        animate: 1000
19
    });
20
 
21
    $('.update-easy-pie-chart').click(function(){
22
        $('.easy-pie-chart .percentage').each(function() {
23
            var newValue = Math.floor(100*Math.random());
24
            $(this).data('easyPieChart').update(newValue);
25
            $('span', this).text(newValue);
26
        });
27
    });
28
 
29
    $('.updateEasyPieChart').on('click', function(e) {
30
        e.preventDefault();
31
        $('.percentage, .percentage-light').each(function() {
32
            var newValue = Math.round(100*Math.random());
33
            $(this).data('easyPieChart').update(newValue);
34
            $('span', this).text(newValue);
35
        });
36
    });
37
 
38
});