Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
21627 kshitij.so 1
var Script = function () {
2
 
3
    $(".sparkline").each(function(){
4
        var $data = $(this).data();
5
 
6
        $data.valueSpots = {'0:': $data.spotColor};
7
 
8
        $(this).sparkline( $data.data || "html", $data,
9
        {
10
            tooltipFormat: '<span style="display:block; padding:0px 10px 12px 0px;">' +
11
            '<span style="color: {{color}}">&#9679;</span> {{offset:names}} ({{percent.1}}%)</span>'
12
        });
13
    });
14
 
15
    /* sparkline chart  */
16
    // barchart
17
    $("#barchart").sparkline([9,8,7,6,5,6,8,6,8,9,6,8,6,5,7,6,5,4,7,4,7,5,6,9], {
18
        type: 'bar',
19
        height: '125',
20
        barWidth: 8,
21
        barSpacing: 5,
22
        barColor: 'rgba(255,255,255,0.6)'
23
    });
24
    $("#barchart-2").sparkline([9,8,7,6,5,6,8,6,8,9,6,8,6,5,7,6,5,4,7,4,7,5,6,9,7,5], {
25
        type: 'bar',
26
        height: '125',
27
        barWidth: 30,
28
        barSpacing: 10,
29
        barColor: 'rgba(252,52,57,0.6)'
30
    });
31
 
32
    // linechart    
33
    $("#linechart").sparkline([1,5,3,7,9,3,6,4,7,9,7,6,2], {
34
        type: 'line',
35
        width: '300',
36
        height: '75',
37
        fillColor: '',
38
        lineColor: '#fff',
39
        lineWidth: 2,
40
        spotColor: '#fff',
41
        minSpotColor: '#fff',
42
        maxSpotColor: '#fff',
43
        highlightSpotColor: '#fff',
44
        highlightLineColor: '#ffffff',
45
        spotRadius: 4,
46
        highlightLineColor: '#ffffff'
47
//        tooltipFormat: '<span style="display:block; padding:0px 10px 12px 0px;">' +
48
//            '<span style="color: {{color}}">&#9679;</span> {{offset:names}} ({{percent.1}}%)</span>'
49
 
50
 
51
 
52
    });
53
 
54
    $("#pie-chart").sparkline([5,3,4,1,2], {
55
        type: 'pie',
56
        width: '100',
57
        height: '100',
58
        borderColor: '#00bf00',
59
        sliceColors: ['#007AFF', '#4CD964','#34AADC', '#FFCC00', '#fc3e39']
60
    });
61
 
62
    $("#pie-chart-2").sparkline([4,5,3,2,1], {
63
        type: 'pie',
64
        width: '150',
65
        height: '150',
66
        sliceColors: ['#007AFF', '#4CD964','#34AADC', '#FFCC00', '#fc3e39']
67
    });
68
 
69
    //work progress bar
70
    $("#work-progress1").sparkline([5,6,7,5,9,6,4], {
71
        type: 'bar',
72
        height: '20',
73
        barWidth: 5,
74
        barSpacing: 2,
75
        barColor: '#5fbf00'
76
    });
77
 
78
    $("#work-progress2").sparkline([3,2,5,8], {
79
        type: 'bar',
80
        height: '22',
81
        barWidth: 5,
82
        barSpacing: 2,
83
        barColor: '#4cd964'
84
    });
85
 
86
    $("#work-progress3").sparkline([1,6,9,3], {
87
        type: 'bar',
88
        height: '22',
89
        barWidth: 5,
90
        barSpacing: 2,
91
        barColor: '#4cd964'
92
    });
93
 
94
    $("#work-progress4").sparkline([6,7,4,3], {
95
        type: 'bar',
96
        height: '22',
97
        barWidth: 5,
98
        barSpacing: 2,
99
        barColor: '#34aadc'
100
    });
101
 
102
    $("#work-progress5").sparkline([6,8,5,7], {
103
        type: 'bar',
104
        height: '22',
105
        barWidth: 5,
106
        barSpacing: 2,
107
        barColor: '#007AFF'
108
    });
109
 
110
}();