Spaces:
Running
Running
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one | |
or more contributor license agreements. See the NOTICE file | |
distributed with this work for additional information | |
regarding copyright ownership. The ASF licenses this file | |
to you under the Apache License, Version 2.0 (the | |
"License"); you may not use this file except in compliance | |
with the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, | |
software distributed under the License is distributed on an | |
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
KIND, either express or implied. See the License for the | |
specific language governing permissions and limitations | |
under the License. | |
--> | |
<html> | |
<head> | |
<meta charset='utf-8'> | |
<script src='lib/simpleRequire.js'></script> | |
<script src='lib/config.js'></script> | |
<script src='lib/jquery.min.js'></script> | |
<script src='lib/testHelper.js'></script> | |
<!-- <script src="lib/canteen.js"></script> --> | |
<link rel="stylesheet" href="lib/reset.css" /> | |
<meta name='viewport' content='width=device-width, initial-scale=1' /> | |
<link rel="stylesheet" href="./stream-basic.css" /> | |
<script src="./stream-basic.js"></script> | |
</head> | |
<body> | |
<style> | |
#snapshot { | |
width: 150; | |
height: 100; | |
background: #fff; | |
border: 5px solid rgba(0,0,0,0.5); | |
} | |
</style> | |
<div id='main0'></div> | |
<div id='record'></div> | |
<img id="snapshot"/> | |
<script> | |
var chart; | |
var recordContainer = document.getElementById('record'); | |
// testHelper.controlFrame({ | |
// pauseAt: 20, | |
// onFrame: function (frameNumber) { | |
// window.printIncrementalOnFrame(chart, frameNumber, recordContainer); | |
// } | |
// }); | |
require(['echarts'], function (echarts) { | |
var count = 2e5; | |
var data = []; | |
for (var i = 0; i < count; i++) { | |
data.push(['c' + i, Math.sin(i / 180 * Math.PI)]); | |
} | |
var option = { | |
tooltip: { | |
trigger: 'axis' | |
}, | |
legend: {}, | |
xAxis: { | |
type: 'category', | |
min: 0, | |
max: count - 1, | |
axisLabel: { | |
showMaxLabel: true, | |
showMinLabel: true | |
} | |
}, | |
yAxis: {}, | |
dataZoom: [{}, {type: 'inside'}], | |
series: [{ | |
type: 'bar', | |
name: 'bar', | |
color: ['green'], | |
progressiveChunkMode: 'sequential', | |
large: true, | |
data: data | |
}] | |
}; | |
chart = testHelper.create(echarts, 'main0', { | |
title: [ | |
count + ' points should be rendered from left to right.', | |
'(1) Check all bars rendered (full of xAxis)', | |
'(2) And check roam.', | |
'(3) Check click legend', | |
'(4) Check snapshot rendering when "finished"' | |
], | |
option: option, | |
autoResize: false, | |
info: { | |
xAxis: option.xAxis, | |
series: {progressiveChunkMode: 'sequential'} | |
} | |
}); | |
chart.on('finished', function () { | |
var url = chart.getDataURL(); | |
var snapshotEl = document.getElementById('snapshot'); | |
snapshotEl.src = url; | |
}); | |
}); | |
</script> | |
</body> | |
</html> |