mirror of
https://github.com/wownero/diff-chart.git
synced 2026-10-17 15:21:25 +02:00
84 lines
2.1 KiB
HTML
84 lines
2.1 KiB
HTML
<html>
|
|
<header><title>Aeon difficulty chart</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="aeon-data.js"></script>
|
|
|
|
<!-- Chart code -->
|
|
<script>
|
|
var chart = AmCharts.makeChart("chartdiv", {
|
|
"type": "serial",
|
|
"theme": "light",
|
|
"marginRight": 80,
|
|
"autoMarginOffset": 20,
|
|
"marginTop": 7,
|
|
"dataProvider": chartData,
|
|
"valueAxes": [{
|
|
"axisAlpha": 0.2,
|
|
"dashLength": 1,
|
|
"position": "left"
|
|
}],
|
|
"mouseWheelZoomEnabled": true,
|
|
"graphs": [{
|
|
"id": "g1",
|
|
"balloonText": "[[value]]",
|
|
"bullet": "round",
|
|
"bulletBorderAlpha": 1,
|
|
"bulletColor": "#FFFFFF",
|
|
"hideBulletsCount": 50,
|
|
"title": "red line",
|
|
"valueField": "difficulty",
|
|
"useLineColorForBulletBorder": true,
|
|
"balloon":{
|
|
"drop":true
|
|
}
|
|
}],
|
|
"chartScrollbar": {
|
|
"autoGridCount": true,
|
|
"graph": "g1",
|
|
"scrollbarHeight": 40
|
|
},
|
|
"chartCursor": {
|
|
"limitToGraph":"g1"
|
|
},
|
|
"categoryField": "height",
|
|
"categoryAxis": {
|
|
"parseDates": false,
|
|
"axisColor": "#DADADA",
|
|
"dashLength": 1,
|
|
"minorGridEnabled": true
|
|
},
|
|
"export": {
|
|
"enabled": true
|
|
}
|
|
});
|
|
|
|
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(chartData.length - 40, chartData.length - 1);
|
|
}
|
|
|
|
</script>
|
|
</header>
|
|
<body>
|
|
<h1>Aeon difficulty chart</h1>
|
|
<div id="chartdiv"></div>
|
|
</body>
|
|
</html>
|