Update custom.html
parent
dc40258a36
commit
39117e7e98
|
|
@ -3,7 +3,7 @@
|
|||
<link rel="stylesheet" href="../../css/spectre.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
<p>Data Test</p>
|
||||
<script src="../../core/lib/customize.js"></script>
|
||||
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
||||
<div id="storageInfo"></div>
|
||||
|
|
@ -12,30 +12,7 @@
|
|||
google.charts.load('current', {'packages':['corechart']});
|
||||
google.charts.setOnLoadCallback(drawChart);
|
||||
|
||||
function drawChart() {
|
||||
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Task', 'Hours per Day'],
|
||||
['Work', 11],
|
||||
['Eat', 2],
|
||||
['Commute', 2],
|
||||
['Watch TV', 2],
|
||||
['Sleep', 7]
|
||||
]);
|
||||
|
||||
var options = {
|
||||
title: 'My Daily Activities'
|
||||
};
|
||||
|
||||
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
|
||||
|
||||
chart.draw(data, options);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
// Called when we know what device we're using
|
||||
|
|
@ -93,6 +70,25 @@
|
|||
document.getElementById("storageInfo").innerHTML = "<p>No apps found</p>";
|
||||
}
|
||||
});
|
||||
|
||||
function drawChart() {
|
||||
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
${apps.map(app => `
|
||||
[${app[0]},${app[1]+app[2]}
|
||||
).join("")}
|
||||
|
||||
]);
|
||||
|
||||
var options = {
|
||||
title: 'My Daily Activities'
|
||||
};
|
||||
|
||||
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
|
||||
|
||||
chart.draw(data, options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue