/
githubmirror
/
echarts
Обзор
Документация
Войти
/
githubmirror
/
echarts
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/axis-filter-extent2.html
247 строк
9 KB
100pah
Fix and add test cases (introduced by preceding commits)
28 мар 2026, 23:33
28 мар 2026, 23:33
3ceabff
Код
Авторство
О чём код?
<!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="main-stack-extreme"></div> <div id="main2"></div> <script> require(['echarts'], function (echarts) { var option = { "dataset": [{ "source": [ ["Calendar", "L1", "L2", "L3", "L4", "L5", "L6"], ["2021-04-09", 3.14, 66.82, 30.04, 0.00, 0.00, 0.00], ["2021-04-10", 2.96, 72.59, 24.44, 0.00, 0.00, 0.00], ["2021-04-11", 3.62, 73.19, 23.19, 0.00, 0.00, 0.00], ["2021-04-12", 5.32, 72.87, 21.81, 0.00, 0.00, 0.00], ["2021-04-13", 3.51, 73.25, 23.24, 0.00, 0.00, 0.00], // If using javascript add, // The sum is 100.00000000000001, over 100. ["2021-04-15", 7.98, 69.15, 22.87, 0.00, 0.00, 0.00], // Over 100. ["2021-04-14", 2.82, 71.75, 125.45, 0.00, 0.00, 0.00], ] }], "tooltip": { "trigger": "axis" }, "legend": { }, "toolbox": { "feature": { // dataZoom: { // filterMode: 'none' // } } }, // dataZoom: { // filterMode: 'none', // yAxisIndex: 0 // }, "xAxis": [ { "type": "category", "boundaryGap": false } ], "yAxis": [ { "type": "value", "min": 0, "max": 100, "axisLabel": { "formatter": "{value} %" } } ], "series": [{ "type": "line", "stack": "总量", "smooth": true, "areaStyle": {}, "emphasis": { "focus": "series" } }, { "type": "line", "stack": "总量", "smooth": true, "areaStyle": {}, "emphasis": { "focus": "series" } }, { "type": "line", "stack": "总量", "smooth": true, "areaStyle": {}, "emphasis": { "focus": "series" } }, { "type": "line", "stack": "总量", "smooth": true, "areaStyle": {}, "emphasis": { "focus": "series" } }, { "type": "line", "stack": "总量", "smooth": true, "areaStyle": {}, "emphasis": { "focus": "series" } }, { "type": "line", "stack": "总量", "smooth": true, "areaStyle": {}, "emphasis": { "focus": "series" } }] }; var chart = testHelper.create(echarts, 'main-stack-extreme', { title: [ 'No dataZoom declared but toolbox declared.', 'The top area should no filterd', 'The last point is over 100' ], option: option, height: 300 }); }); </script> <script> require(['echarts'], function (echarts) { var _ctx = { yAxisMin: { value: 'NOT_SET', values: ['NOT_SET', 200, 1500] }, yAxisMax: { value: 500, values: ['NOT_SET', 500, 820, 1000] }, br: {}, yAxisScale: { value: 'NOT_SET', values: ['NOT_SET', false, true], }, series1Type: { value: 'bar', values: ['scatter', 'bar'], }, yAxisInverse: { value: 'NOT_SET', values: ['NOT_SET', false, true], }, }; function createOption() { var option = { legend: {}, xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], }, yAxis: { type: 'value', // it works // max: 820 // less than the min value of data // max: 500 }, series: [ { data: [820, 932, 901, 934, 1290, 1330, 1320], type: 'line', name: 'line', }, { data: [820, 932, 901, 934, 1290, 1330, 1320], type: _ctx.series1Type.value, name: 'bar', } ] }; if (_ctx.yAxisMin.value !== 'NOT_SET') { option.yAxis.min = _ctx.yAxisMin.value; } if (_ctx.yAxisMax.value !== 'NOT_SET') { option.yAxis.max = _ctx.yAxisMax.value; } if (_ctx.yAxisScale.value !== 'NOT_SET') { option.yAxis.scale = _ctx.yAxisScale.value; } if (_ctx.yAxisInverse.value !== 'NOT_SET') { option.yAxis.inverse = _ctx.yAxisInverse.value; } return option; } function updateChart() { chart.setOption(createOption(), {notMerge: true}); } var chart = testHelper.create(echarts, 'main2', { title: [ 'The **line** series should be **invisible**', 'The **bar** series should be **partially visible**', 'NOTE: series data range is **[820, 1320]**', 'The y-axis should be shown', 'The initial max value of y-axis should be **500**' ], option: createOption(), height: 300, inputsStyle: 'compact', inputs: testHelper.createInputsSimply(_ctx, updateChart) }); }); </script> </body> </html>