limit number of dots being drawn to 200k

This commit is contained in:
stoffu
2019-01-09 22:29:37 +09:00
parent 4bbb70cfeb
commit da6290dc94
4 changed files with 12 additions and 1 deletions
+1
View File
@@ -52,6 +52,7 @@ function togglePan() {
</header>
<body>
<h1>Aeon nonce</h1>
<p>Since drawing many points in amCharts is somehow very slow and can make your browser unresponsive, the maximum number of points being drawn is limited to 200000 which is what the initial zoom level shows. For easily viewing the past data, use the "Show all" button to maximally zoom out and then use mouse dragging to select the time period as you wish.</p>
<div id="chartdiv"></div>
<p><input type="checkbox" id="pan" onclick="togglePan()">Enable panning</p>
<p><a href="./">Back to top</a></p>
+9 -1
View File
@@ -1,3 +1,5 @@
var max_num_bullets = 200000;
function get_chart(chartData) {
chartData.shift();
@@ -26,6 +28,7 @@ function get_chart(chartData) {
"bullet": "square",
"bulletSize": 1,
"minBulletSize": 1,
"hideBulletsCount": max_num_bullets,
"balloonText": "Height: <b>[[height]]</b>\nNonce: <b>[[value]]</b>\n",
"showBalloonAt": "close",
"title": "nonce",
@@ -35,6 +38,11 @@ function get_chart(chartData) {
"animationDuration": 0,
}
}],
"chartScrollbar": {
"autoGridCount": true,
"graph": "g1",
"scrollbarHeight": 40
},
"chartCursor": {
"pan": false,
"categoryBalloonEnabled": false,
@@ -58,7 +66,7 @@ function get_chart(chartData) {
// 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);
chart.zoomToIndexes(Math.max(0, chartData.length - max_num_bullets), chartData.length - 1);
}
chart.addListener("rendered", zoomChart);
zoomChart();
+1
View File
@@ -66,6 +66,7 @@ function togglePan() {
</header>
<body>
<h1>Monero nonce</h1>
<p>Since drawing many points in amCharts is somehow very slow and can make your browser unresponsive, the maximum number of points being drawn is limited to 200000 which is what the initial zoom level shows. For easily viewing the past data, use the "Show all" button to maximally zoom out and then use mouse dragging to select the time period as you wish.</p>
<div id="chartdiv"></div>
<p><input type="checkbox" id="pan" onclick="togglePan()">Enable panning</p>
<p><a href="./">Back to top</a></p>
+1
View File
@@ -30,6 +30,7 @@ function togglePan() {
</header>
<body>
<h1>Wownero nonce</h1>
<p>Since drawing many points in amCharts is somehow very slow and can make your browser unresponsive, the maximum number of points being drawn is limited to 200000 which is what the initial zoom level shows. For easily viewing the past data, use the "Show all" button to maximally zoom out and then use mouse dragging to select the time period as you wish.</p>
<div id="chartdiv"></div>
<p><input type="checkbox" id="pan" onclick="togglePan()">Enable panning</p>
<p><a href="./">Back to top</a></p>