Graficos Chart.js
Publicado por Juan Pablo (2 intervenciones) el 18/02/2016 04:15:23
Buenas noches, estoy haciendo unos graficos usando chart.js. Esta muy bueno, pero no logre hacer funcionar los graficos teniendo 2 tipos de graficos iguales, ej: dos piechart. les adjunto el codigo.
Espero puedan darme una mano
Saludos
CODIGO:
Espero puedan darme una mano
Saludos
CODIGO:
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
//-------------
//- PIE CHART1
//-------------
var PieData = [
{
value: 2,
color: "#dd4b39",
highlight: "#FFC0CB",
label: "2"
},
{
value: 1,
color: "#3c8dbc",
highlight: "#9dc6dd",
label: "1"
}
];
window.onload = function () {
var ctx = document.getElementById("pieChart").getContext("2d");
window.myDoughnut = new Chart(ctx).Doughnut(PieData, { responsive: true });
};
//-------------
//- PIE CHART 2
//-------------
// Get context with jQuery - using jQuery's .get() method.
var PieData2 = [
{
value: 2,
color: "#dd4b39",
highlight: "#FFC0CB",//"#FFF2F4",//"#f56954"
label: "2"
},
{
value: 1,
color: "#3c8dbc",
highlight: "#9dc6dd",
label: "1"
}
];
window.onload = function () {
var ctxpagaron = document.getElementById("pieChartOtro").getContext("2d");
window.myDoughnut = new Chart(ctxpagaron).Doughnut(PieData2, { responsive: true });
};
Valora esta pregunta


0