g1-stats/tpl/nbr_wallets.html

68 lines
1.5 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="../js/Chart.js"></script>
</head>
<body>
<canvas id="myChart" width="1000" height="500"></canvas>
<script>
var jsonfile = {
"jsonarray": [
_JSONDATA
]
};
var date = jsonfile.jsonarray.map(function(e) {
return e.date;
});
var nbrwallets = jsonfile.jsonarray.map(function(e) {
return e.nbrWallets;
});
var nbrmembres = jsonfile.jsonarray.map(function(e) {
return e.nbrMembres;
});
var ctx = document.getElementById("myChart");
var config = {
type: 'line',
data: {
labels: date,
datasets: [{
label: 'Nombre de simple portefeuilles',
data: nbrwallets,
backgroundColor: 'rgba(0, 119, 204, 0.3)',
pointBorderWidth: 1,
pointHoverRadius: 8,
pointHoverBackgroundColor: "beige",
pointHoverBorderColor: "brown",
pointHoverBorderWidth: 2,
pointRadius: 3,
pointHitRadius: 8
}, {
label: 'Nombre de portefeuilles membres',
data: nbrmembres,
backgroundColor: 'rgba(0, 178, 0, 0.3)',
pointBorderWidth: 1,
pointHoverRadius: 8,
pointHoverBackgroundColor: "beige",
pointHoverBorderColor: "brown",
pointHoverBorderWidth: 2,
pointRadius: 3,
pointHitRadius: 8
}]
},
options: {
maintainAspectRatio: false
}
};
var myChart = new Chart(ctx, config);
</script>
</body>
</html>