/
githubmirror
/
echarts
Обзор
Документация
Войти
/
githubmirror
/
echarts
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
5.4.2
test/dataZoom-scroll.html
348 строк
11 KB
pissang
test: optimize loader
07 май 2021, 08:02
07 май 2021, 08:02
210f650
Код
Авторство
О чём код?
<!-- 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/facePrint.js"></script> <script src="lib/testHelper.js"></script> <link rel="stylesheet" href="lib/reset.css" /> </head> <body> <style> h1 { line-height: 60px; height: 60px; background: #ddd; text-align: center; font-weight: bold; font-size: 14px; } .chart { height: 500px; } </style> <div class="chart" id="d3"></div> <div class="chart" id="d4"></div> <div class="chart" id="d5"></div> <script> require([ 'data/rainfall.json.js', 'echarts' ], function (data, echarts) { var option = { tooltip: { trigger: 'axis' }, grid: [ { show: true, borderWidth: 0 } ], xAxis: [ { type: 'category', boundaryGap: true, axisLabel: {show: true}, splitLine: {show: false}, data: data.category, gridIndex: 0 } ], yAxis: [ { boundaryGap: false, axisLabel: { }, axisLine: { lineStyle: { color: '#666' } }, gridIndex: 0 } ], series: [ { name: '降水量', type: 'line', data: data.rainfall, itemStyle: { normal: { areaStyle: {} } }, xAxisIndex: 0, yAxisIndex: 0, } ], dataZoom: [ { type: 'inside', zoomOnMouseWheel: false, xAxisIndex: 0, // zoomLock: true, start: 30, end: 40 }, { type: 'inside', yAxisIndex: 0, zoomOnMouseWheel: false, moveOnMouseWheel: true, // zoomLock: true, start: 30, end: 40 }, { type: 'slider', start: 30, end: 40 }, { type: 'slider', yAxisIndex: 0 } ] }; testHelper.create(echarts, 'd3', { title: 'Simulate browser scroll bar on y scroll', option: option, height: 400 }); }) </script> <script> require([ 'data/rainfall.json.js', 'echarts' ], function (data, echarts) { var option = { tooltip: { trigger: 'axis' }, grid: [ { show: true, borderWidth: 0 } ], xAxis: [ { type: 'category', boundaryGap: true, axisLabel: {show: true}, splitLine: {show: false}, data: data.category, gridIndex: 0 } ], yAxis: [ { boundaryGap: false, axisLabel: { }, axisLine: { lineStyle: { color: '#666' } }, gridIndex: 0, inverse: true } ], series: [ { name: '降水量', type: 'line', data: data.rainfall, itemStyle: { normal: { areaStyle: {} } }, xAxisIndex: 0, yAxisIndex: 0, } ], dataZoom: [ { type: 'inside', zoomOnMouseWheel: false, xAxisIndex: 0, // zoomLock: true, start: 80, end: 100 }, { type: 'slider', start: 30, end: 40 }, { type: 'inside', yAxisIndex: 0, zoomOnMouseWheel: false, moveOnMouseWheel: true, // zoomLock: true, start: 30, end: 40 }, { type: 'slider', yAxisIndex: 0 } ] }; testHelper.create(echarts, 'd4', { title: [ 'Simulate browser scroll bar on y scroll, y axis inversed', 'The scroll direction should be the same as page scroll' ], option: option, height: 400 }); }) </script> <script> require([ 'data/rainfall.json.js', 'echarts' ], function (data, echarts) { var option = { tooltip: { trigger: 'axis' }, grid: [ { show: true, borderWidth: 0 } ], xAxis: [ { type: 'category', boundaryGap: true, axisLabel: {show: true}, splitLine: {show: false}, data: data.category, gridIndex: 0, inverse: true } ], yAxis: [ { boundaryGap: false, axisLabel: { }, axisLine: { lineStyle: { color: '#666' } }, gridIndex: 0 } ], series: [ { name: '降水量', type: 'line', data: data.rainfall, itemStyle: { normal: { areaStyle: {} } }, xAxisIndex: 0, yAxisIndex: 0, } ], dataZoom: [ { type: 'inside', zoomOnMouseWheel: false, yAxisIndex: 0, // zoomLock: true, start: 80, end: 100 }, { type: 'slider', yAxisIndex: 0, start: 30, end: 40 }, { type: 'inside', xAxisIndex: 0, zoomOnMouseWheel: false, moveOnMouseWheel: true, // zoomLock: true, start: 30, end: 40 }, { type: 'slider', xAxisIndex: 0 } ] }; testHelper.create(echarts, 'd5', { title: [ 'Simulate browser scroll bar on x scroll, x axis inversed', 'The scroll direction should be the same as page scroll' ], option: option, height: 400 }); }) </script> </body> </html>