change dashboard line chart to bar chart

This commit is contained in:
Wilhelm B 2017-03-29 21:50:41 +02:00
parent 62d6861ee7
commit 682ef01cf9

View File

@ -1,15 +1,74 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>Statistics</title> <title>Statistics</title>
<script src="qrc:/html/Chart.js"></script> <script src="qrc:/html/Chart.js"></script>
<script src="qrc:/html/utils.js"></script> <script src="qrc:/html/utils.js"></script>
</head> </head>
<body> <body>
<div style="width:100%; height:100%;"> <div style="width:100%; height:100%;">
<canvas id="canvas" height="360" width="890"></canvas> <canvas id="canvas" height="360" width="890"></canvas>
</div> </div>
<script> <script>
var barChartData = {
type:'bar',
data:{
labels : ["Functions","Imports","Symbols","Strings","Relocs", "Sections"],
datasets:[
{
fill: false,
lineTension: 0.1,
borderCapStyle: 'butt',
borderDash: [],
borderDashOffset: 0.0,
borderJoinStyle: 'miter',
pointBorderWidth: 1,
pointHoverRadius: 5,
pointHoverBorderWidth: 2,
pointRadius: 1,
pointHitRadius: 10,
spanGaps: false,
label: "Found",
backgroundColor: window.chartColors.blue,
borderColor: window.chartColors.blue,
data : [MEOW]
}
]
},
options: {
responsive: true,
legend:{
display: false,
},
title:{
display: false,
text:'bar chart '
},
tooltips:{
mode:'index',
intersect: false,
displayColors: false,
},
hover:{
mode:'nearest',
intersect: false,
},
animation:{
duration: 0
},
scales:{
xAxes: [{
display: true,
scaleLabel:{
display: true,
labelString: 'Flags'
}
}]
}
}
};
var lineChartData = { var lineChartData = {
type: 'line', type: 'line',
data: { data: {
@ -36,51 +95,51 @@
] ]
}, },
options: { options: {
responsive: true, responsive: true,
legend: { legend: {
display: false, display: false,
}, },
title:{ title:{
display: false, display: false,
text:'Binary statistics' text:'Binary statistics'
}, },
tooltips: { tooltips: {
mode: 'index', mode: 'index',
intersect: false, intersect: false,
displayColors: false, displayColors: false,
}, },
hover: { hover: {
mode: 'nearest', mode: 'nearest',
intersect: true intersect: true
}, },
animation: { animation: {
duration: 0 duration: 0
}, },
scales: { scales: {
xAxes: [{ xAxes: [{
display: true,
scaleLabel: {
display: true, display: true,
labelString: 'Flags' scaleLabel: {
} display: true,
}], labelString: 'Flags'
yAxes: [{ }
display: true, }],
scaleLabel: { yAxes: [{
display: true, display: true,
labelString: 'Value' scaleLabel: {
} display: true,
}] labelString: 'Value'
} }
}]
}
} }
}; };
window.onload = function(){ window.onload = function(){
var ctx = document.getElementById("canvas").getContext("2d"); var ctx = document.getElementById("canvas").getContext("2d");
window.myLine = new Chart(ctx, lineChartData); window.myLine = new Chart(ctx, barChartData);
} }
</script> </script>
</body> </body>
</html> </html>