-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
92 lines (82 loc) · 1.84 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Bar Chart
var barChart = document.getElementById('bar-chart').getContext('2d');
var data = {
labels: ['India', 'USA', 'Canada', 'Australia', 'UK', 'China'],
datasets: [{
label: 'Top Students Department',
data: [31, 28, 26, 23, 20, 14,8 ],
backgroundColor: [
'rgb(0, 98, 169)',
'rgba(244, 197, 75, 0.8)',
'rgb(0, 98, 169)',
'rgba(244, 197, 75, 0.8)',
'rgb(0, 98, 169)',
'rgba(244, 197, 75, 0.8)',
],
// borderColor: 'rgba(54, 162, 235, 1)',
borderWidth: 1
}]
};
var options = {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
};
var myBarChart = new Chart(barChart, {
type: 'horizontalBar',
data: data,
options: options,
});
// progrees bar in card
let progressBar = document.querySelector('.progress-bar');
let value = 25; // Change this value to update the progress
progressBar.style.width = value + '%';
progressBar.setAttribute('aria-valuenow', value);
/// new page
// Bar chart 1
var ctx1 = document.getElementById('bar-chart-1').getContext('2d');
var myChart1 = new Chart(ctx1, {
type: 'horizontalBar',
data: {
labels: ['Chapter1', 'Chapter2', 'Chapter3'],
datasets: [{
data: [20, 20, 3],
backgroundColor: [
'rgb(0, 98, 169)',
'rgb(208, 208, 208)',
'rgb(0, 98, 169)',
],
// borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
// progress bar of learner dashboard
var i = 0;
function move() {
if (i == 0) {
i = 1;
var elem = document.getElementById("myBar");
var width = 1;
var id = setInterval(frame, 10);
function frame() {
if (width >= 100) {
clearInterval(id);
i = 0;
} else {
width++;
elem.style.width = width + "%";
}
}
}
}