/
githubmirror
/
echarts
Обзор
Документация
Войти
/
githubmirror
/
echarts
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
5.3.2
test/appendData.html
315 строк
9 KB
pissang
test: use simpleRequire to replace esl
06 май 2021, 11:47
06 май 2021, 11:47
8544dd7
Код
Авторство
О чём код?
<!DOCTYPE html> <!-- 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"> <meta name="viewport" content="width=device-width, initial-scale=1" /> <script src="lib/simpleRequire.js"></script> <script src="lib/config.js"></script> <script src="lib/jquery.min.js"></script> <script src="lib/facePrint.js"></script> <script src="lib/testHelper.js"></script> <link rel="stylesheet" href="lib/reset.css" /> </head> <body> <style> .test-title { background: #146402; color: #fff; } </style> <!-- Thanks to <https://github.com/Truantboy>, see: #7718. --> <div id="main0"></div> <div id="main1"></div> <div id="main2"></div> <div id="main4"></div> <script> require([ 'echarts'/*, 'map/js/china' */ ], function (echarts) { var option = { animation: true, tooltip: {}, xAxis: {}, yAxis: {}, series: [{ type: 'scatter', // name: 'data', data: [[0, 0], [3005, 3005]], progressiveThreshold: 3000, symbol: 'triangle', symbolSize: 20 }] }; var yBase = 500; var appendCount = 2990; var myChart = testHelper.create(echarts, 'main0', { title: [ '(1) Click btn to appendData less than limit, should render thousands of points normally.', '(2) Click again, should appendData normally.', '(3) Check hover (emphasis), should no scale but highlighted.' ], option: option, info: option.series, infoKey: 'series', button: { text: 'Click to appendData ' + appendCount + ' points', onClick: function () { var tp = [] for(var i = 0; i < appendCount; i++) { tp[i] = [i, yBase]; } myChart.appendData({ seriesIndex: 0, data: tp }); yBase += 1000; } } }); }); </script> <script> require([ 'echarts'/*, 'map/js/china' */ ], function (echarts) { var option = { animation: true, tooltip: {}, xAxis: {}, yAxis: {}, legend: {}, series: [{ type: 'scatter', name: 'data', data: [[0, 0], [3005, 3005]], progressiveThreshold: 3000, symbol: 'triangle', symbolSize: 20 }] }; var yBase = 500; var appendCount = 4000; var myChart = testHelper.create(echarts, 'main1', { title: [ '(1) Click btn to appendData over limit, should render successfully.', '(2) Grid extent will not be modified, even if point overflow the extent.', '(3) Then test click legend, should be normal.' ], option: option, info: option.series, infoKey: 'series', button: { text: 'Click to appendData ' + appendCount + ' points', onClick: function () { var tp = [] for(var i = 0; i < appendCount; i++) { tp[i] = [i, yBase]; } myChart.appendData({ seriesIndex: 0, data: tp }); yBase += 1000; } } }); }); </script> <script> require([ 'echarts' ], function (echarts) { var option = { animation: true, tooltip: {}, xAxis: {}, yAxis: {}, series: [{ type: 'scatter', data: [[0, 0], [2005, 2005]], progressiveThreshold: 2000, largeThreshold: 3000, symbolSize: 20 }, { type: 'scatter', data: [[100, 1000], [300, 1005]] }] }; var appendCount = 2000; var chart = testHelper.create(echarts, 'main2', { title: [ 'Click to appendData over limit, color should be the same.' ].join('\n'), option: option, info: option.series, infoKey: 'series', button: { text: 'Click to appendData ' + appendCount + ' points', onClick: function () { var tp = [] for(var i = 0; i < appendCount; i++) { tp[i] = [i, 1]; } chart.appendData({ seriesIndex: 0, data: tp }); } } }); }); </script> <script> require([ 'echarts'/*, 'map/js/china' */ ], function (echarts) { var option = { animation: true, tooltip: {}, xAxis: { // axisLine: {show: false}, // axisLabel: {show: false}, // axisTick: {show: false}, // splitLine: {show: false} }, yAxis: { // axisLine: {show: false}, // axisLabel: {show: false}, // axisTick: {show: false}, // splitLine: {show: false} }, legend: { }, // hoverLayerThreshold: 1, series: [{ type: 'scatter', name: 'data', data: [[3005, 3005]], progressiveThreshold: 1, symbol: 'triangle', symbolSize: 20 }] }; var yBase = 500; var appendCount = 1; var myChart = testHelper.create(echarts, 'main4', { title: [ '(1) Points over limit, test click legend, should be normal.', '(2) Click btn to appendData, test click legend, should be normal.' ], option: option, info: option.series, infoKey: 'series', button: { text: 'Click to appendData ' + appendCount + ' points', onClick: function () { var tp = [] for(var i = 0; i < appendCount; i++) { tp[i] = [i, yBase]; } myChart.appendData({ seriesIndex: 0, data: tp }); yBase += 1000; } } }); }); </script> </body> </html>