forked from wownero/diff-chart
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
144 lines
4.4 KiB
144 lines
4.4 KiB
<html>
|
|
<header><title>Monero blockchain size</title>
|
|
<!-- Styles -->
|
|
<style>
|
|
#chartdiv {
|
|
width : 100%;
|
|
height : 500px;
|
|
}
|
|
</style>
|
|
|
|
<!-- Resources -->
|
|
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
|
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
|
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
|
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
|
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
|
<script src="monero-data-0.js"></script>
|
|
<script src="monero-data-1.js"></script>
|
|
<script src="monero-data-2.js"></script>
|
|
<script src="monero-data-3.js"></script>
|
|
<script src="monero-data-4.js"></script>
|
|
<script src="monero-data-5.js"></script>
|
|
<script src="monero-data-6.js"></script>
|
|
<script src="monero-data-7.js"></script>
|
|
<script src="monero-data-8.js"></script>
|
|
<script src="monero-data-9.js"></script>
|
|
<script src="monero-data-10.js"></script>
|
|
<script src="monero-data-11.js"></script>
|
|
<script src="monero-data-12.js"></script>
|
|
<script src="monero-data-13.js"></script>
|
|
<script src="monero-data-14.js"></script>
|
|
<script src="monero-data-15.js"></script>
|
|
<script src="monero-data-16.js"></script>
|
|
|
|
<!-- Chart code -->
|
|
<script>
|
|
var chartData = chartData_0;
|
|
chartData.shift();
|
|
chartData = chartData.concat(chartData_1);
|
|
chartData = chartData.concat(chartData_2);
|
|
chartData = chartData.concat(chartData_3);
|
|
chartData = chartData.concat(chartData_4);
|
|
chartData = chartData.concat(chartData_5);
|
|
chartData = chartData.concat(chartData_6);
|
|
chartData = chartData.concat(chartData_7);
|
|
chartData = chartData.concat(chartData_8);
|
|
chartData = chartData.concat(chartData_9);
|
|
chartData = chartData.concat(chartData_10);
|
|
chartData = chartData.concat(chartData_11);
|
|
chartData = chartData.concat(chartData_12);
|
|
chartData = chartData.concat(chartData_13);
|
|
chartData = chartData.concat(chartData_14);
|
|
chartData = chartData.concat(chartData_15);
|
|
chartData = chartData.concat(chartData_16);
|
|
|
|
// https://stackoverflow.com/a/18650828
|
|
function formatBytes(bytes, decimal) {
|
|
if (0 == bytes)
|
|
return "0 bytes";
|
|
var c = 1024;
|
|
var d = decimal || 2;
|
|
var e = ["bytes", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
var f = Math.floor(Math.log(bytes) / Math.log(c));
|
|
return "<b>" + parseFloat((bytes / Math.pow(c, f)).toFixed(d)) + "</b> " + e[f]
|
|
}
|
|
|
|
for (var i = 0; i < chartData.length; ++i) {
|
|
chartData[i].bc_size = chartData[i].block_size;
|
|
if (i > 0)
|
|
chartData[i].bc_size += chartData[i - 1].bc_size;
|
|
chartData[i].bc_size_str = formatBytes(chartData[i].bc_size, 3);
|
|
}
|
|
|
|
var chart = AmCharts.makeChart("chartdiv", {
|
|
"type": "serial",
|
|
"theme": "light",
|
|
"marginRight": 80,
|
|
"autoMarginOffset": 20,
|
|
"marginTop": 7,
|
|
"dataProvider": chartData,
|
|
"valueAxes": [{
|
|
"axisAlpha": 0,
|
|
}],
|
|
"mouseWheelZoomEnabled": true,
|
|
"graphs": [{
|
|
"id": "g1",
|
|
"lineColor": "#07ab82",
|
|
"balloonText": "Size: [[bc_size_str]]\nHeight: <b>[[height]]</b>",
|
|
"bullet": "round",
|
|
"bulletBorderAlpha": 1,
|
|
"bulletColor": "#FFFFFF",
|
|
"hideBulletsCount": 50,
|
|
"title": "block size",
|
|
"valueField": "bc_size",
|
|
"useLineColorForBulletBorder": true,
|
|
"balloon":{
|
|
"cornerRadius": 10,
|
|
}
|
|
}],
|
|
"chartScrollbar": {
|
|
"autoGridCount": true,
|
|
"graph": "g1",
|
|
"scrollbarHeight": 40
|
|
},
|
|
"chartCursor": {
|
|
"pan": false
|
|
},
|
|
"categoryField": "date",
|
|
"categoryAxis": {
|
|
"parseDates": true,
|
|
"minPeriod": "ss",
|
|
"axisColor": "#DADADA",
|
|
"dashLength": 1,
|
|
"minorGridEnabled": true
|
|
},
|
|
"export": {
|
|
"enabled": true,
|
|
"position": "bottom-right"
|
|
}
|
|
});
|
|
|
|
chart.addListener("rendered", zoomChart);
|
|
zoomChart();
|
|
|
|
// this method is called when chart is first inited as we listen for "rendered" event
|
|
function zoomChart() {
|
|
// different zoom methods can be used - zoomToIndexes, zoomToDates, zoomToCategoryValues
|
|
chart.zoomToIndexes(0, chartData.length - 1);
|
|
}
|
|
|
|
function togglePan() {
|
|
chart.chartCursor.pan = document.getElementById("pan").checked;
|
|
}
|
|
|
|
</script>
|
|
</header>
|
|
<body>
|
|
<h1>Monero blockchain size</h1>
|
|
<div id="chartdiv"></div>
|
|
<p><input type="checkbox" id="pan" onclick="togglePan()">Enable panning</p>
|
|
<p><a href="./">Back to top</a></p>
|
|
</body>
|
|
</html>
|