-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchart.js
More file actions
63 lines (40 loc) · 1017 Bytes
/
chart.js
File metadata and controls
63 lines (40 loc) · 1017 Bytes
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
const ctx = document.getElementById('myChart');
const DATA_COUNT = 7;
const NUMBER_CFG = {count: DATA_COUNT, min: -100, max: 100};
const labels = ["190", "210","230","250","270", "290", "310"]; //valor 1 dolar en pesos
const data1=labels.map(x => parseInt(5000000 / parseInt(x)));
const data = {
labels: labels,
datasets: [
{
label: 'Dolar Vs pesos',
data: data1,
borderColor: '#FF2D00',
backgroundColor: '#FA8072',
}
]
};
const config = {
type: 'line',
data: data,
options: {
responsive: true,
scale: {
ticks: {
stepSize: 1,
precision: 0,
beginAtZero: true
}
},
plugins: {
legend: {
position: 'top',
},
title: {
display: true,
text: 'Valor en dolares de 5 millones de pesos'
}
}
},
};
const myChart = new Chart(ctx, config);