| <!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"> |
| <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> |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| <link rel="stylesheet" href="lib/reset.css"> |
| </head> |
| <body> |
| <style> |
| .test-title { |
| background: #b8d4ff; |
| color: #000; |
| } |
| </style> |
| |
| <div class="chart" id="main0"></div> |
| <div class="chart" id="main1"></div> |
| |
| |
| |
| |
| |
| |
| |
| <script> |
| |
| require([ |
| 'echarts' |
| ], function (echarts) { |
| |
| var xAxisData = []; |
| var data1 = []; |
| var data3 = []; |
| |
| for (var i = 0; i < 100; i++) { |
| xAxisData.push('category' + i); |
| data1.push((Math.random() * 5).toFixed(2) * 1e6); |
| data3.push((Math.random() + 0.5).toFixed(2) * 1e6); |
| } |
| |
| var option = { |
| backgroundColor: '#fe9', |
| tooltip: { |
| trigger: 'axis', |
| axisPointer: { |
| type: 'shadow' |
| } |
| }, |
| xAxis: { |
| id: 'xx', |
| data: xAxisData, |
| axisTick: { |
| interval: 4, |
| alignWithLabel: true |
| }, |
| axisLabel: { |
| }, |
| splitArea: { |
| show: true |
| } |
| }, |
| yAxis: { |
| id: 'yy', |
| axisTick: { |
| show: false |
| }, |
| splitArea: { |
| show: false |
| } |
| }, |
| grid: { |
| left: 0, |
| top: 0, |
| bottom: 0, |
| right: 0, |
| containLabel: true |
| }, |
| dataZoom: [{ |
| type: 'inside', |
| startValue: 17, |
| endValue: 24 |
| }], |
| series: [{ |
| name: 'bar', |
| type: 'bar', |
| stack: 'one', |
| cursor: 'move', |
| data: data1 |
| }, { |
| name: 'bar3', |
| type: 'bar', |
| stack: 'two', |
| data: data3 |
| }] |
| }; |
| |
| var chart = testHelper.create(echarts, 'main0', { |
| title: [ |
| 'Check containLabel' |
| ], |
| option: option, |
| info: {grid: option.grid}, |
| }); |
| |
| var rotate = 0; |
| |
| chart && next(); |
| |
| function next() { |
| var nextInterval = rotate % 90 === 0 ? 2000: 70; |
| rotate = (rotate + 1) % 90; |
| setTimeout(function () { |
| chart.setOption({ |
| xAxis: { |
| id: 'xx', |
| axisLabel: { |
| rotate: rotate |
| } |
| }, |
| yAxis: { |
| id: 'yy', |
| axisLabel: { |
| rotate: rotate |
| } |
| } |
| }); |
| next(); |
| }, nextInterval); |
| } |
| |
| }); |
| |
| </script> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <script> |
| |
| require([ |
| 'echarts' |
| ], function (echarts) { |
| |
| var xAxisData = []; |
| var data1 = []; |
| var data3 = []; |
| |
| for (var i = 0; i < 100; i++) { |
| xAxisData.push('category' + i); |
| data1.push((Math.random() * 5).toFixed(2) * 1e6); |
| data3.push((Math.random() + 0.5).toFixed(2) * 1e6); |
| } |
| |
| var option = { |
| backgroundColor: '#fe9', |
| tooltip: { |
| trigger: 'axis', |
| axisPointer: { |
| type: 'shadow' |
| } |
| }, |
| xAxis: [{ |
| id: 'x0', |
| data: xAxisData, |
| axisTick: { |
| interval: 4, |
| alignWithLabel: true |
| }, |
| axisLabel: { |
| }, |
| splitArea: { |
| show: true |
| } |
| }, { |
| id: 'x1', |
| data: xAxisData, |
| axisTick: { |
| interval: 4, |
| alignWithLabel: true |
| }, |
| axisLabel: { |
| }, |
| splitArea: { |
| show: true |
| } |
| }], |
| yAxis: [{ |
| id: 'y0', |
| axisTick: { |
| show: false |
| }, |
| splitArea: { |
| show: false |
| } |
| }, { |
| id: 'y1', |
| axisTick: { |
| show: false |
| }, |
| splitArea: { |
| show: false |
| } |
| }], |
| grid: { |
| left: 0, |
| top: 0, |
| bottom: 0, |
| right: 0, |
| containLabel: true |
| }, |
| dataZoom: [{ |
| type: 'inside', |
| startValue: 17, |
| endValue: 24 |
| }], |
| series: [{ |
| name: 'bar', |
| type: 'bar', |
| stack: 'one', |
| cursor: 'move', |
| data: data1 |
| }, { |
| name: 'bar3', |
| xAxisIndex: 1, |
| yAxisIndex: 1, |
| type: 'bar', |
| stack: 'two', |
| data: data3 |
| }] |
| }; |
| |
| var chart = testHelper.create(echarts, 'main1', { |
| title: [ |
| 'Check containLabel' |
| ], |
| option: option, |
| info: {grid: option.grid}, |
| }); |
| |
| var rotate = 0; |
| |
| chart && next(); |
| |
| function next() { |
| var nextInterval = rotate % 90 === 0 ? 2000: 70; |
| rotate = (rotate + 1) % 90; |
| setTimeout(function () { |
| chart.setOption({ |
| xAxis: [ |
| {id: 'x0', axisLabel: {rotate: rotate}}, |
| {id: 'x1', axisLabel: {rotate: rotate}} |
| ], |
| yAxis: [ |
| {id: 'y0', axisLabel: {rotate: rotate}}, |
| {id: 'y1', axisLabel: {rotate: rotate}} |
| ] |
| }); |
| next(); |
| }, nextInterval); |
| } |
| |
| }); |
| |
| </script> |
| |
| |
| |
| |
| |
| |
| |
| |
| </body> |
| </html> |