/
githubmirror
/
echarts
Обзор
Документация
Войти
/
githubmirror
/
echarts
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/scale-extreme-number.html
175 строк
5 KB
100pah
fix regression: Fix NPE and simplify code.
09 апр 2026, 18:59
09 апр 2026, 18:59
e5744ce
Код
Авторство
О чём код?
<!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> <!-- <script src="ut/lib/canteen.js"></script> --> <link rel="stylesheet" href="lib/reset.css" /> </head> <body> <style> </style> <div id="main0"></div> <div id="main_candlestick"></div> <script> require([ 'echarts', ], function (echarts) { var _ctx = { yAxisType: { text: 'yAxis.type:', value: 'value', values: ['value', 'log', 'time'], } }; function createOption() { var data; if (_ctx.yAxisType.value === 'time') { var timeBase = 1775675465411; data = [ [0, timeBase + 1], [1, timeBase + 2], [2, timeBase + 5], [3, timeBase + 7] ]; } else { data = [ [0, 0.000000000012], [1, 0.000000000034], [2, 0.000000000010], [3, 0.000000000038] ]; } var option = { xAxis: { type: 'category', data: ['2017-10-24', '2017-10-25', '2017-10-26', '2017-10-27'] }, yAxis: { type: _ctx.yAxisType.value, scale: true, axisLabel: { // formatter(value) { // return value.toExponential(); // } }, axisLine: { show: true, }, axisTick: { show: true, }, splitLine: { show: true, }, minorTick: { show: true, }, }, tooltip: {}, series: [{ type: 'line', data: data }] }; return option; } function updateChart() { chart.setOption(createOption(), {notMerge: true}); } var chart = testHelper.create(echarts, 'main0', { title: [ 'extreme small number in scale (line)', ], option: createOption(), inputs: testHelper.createInputsSimply(_ctx, updateChart) }); }); </script> <script> require([ 'echarts', ], function (echarts) { var option; function makeYAxisOption(type) { return { type: type, scale: true, // axisLabel: { // formatter(value) { // return value.toExponential(); // } // } }; } option = { xAxis: { type: 'category', data: ['2017-10-24', '2017-10-25', '2017-10-26', '2017-10-27'] }, yAxis: makeYAxisOption(), tooltip: {}, series: [{ type: 'candlestick', data: [ [0.000000000012, 0.000000000034, 0.000000000010, 0.000000000038] ] }] }; var chart = testHelper.create(echarts, 'main_candlestick', { title: [ 'extreme small number in scale (candlestick)', ], option: option, }); }); </script> </body> </html>