| |
| <!-- |
| 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> |
| </head> |
| <body> |
| <style> |
| html, body, #main { |
| width: 100%; |
| height: 100%; |
| } |
| </style> |
| <div id="main"></div> |
| <script> |
| |
| |
| require([ |
| 'echarts' |
| ], function (echarts) { |
| |
| var chart = echarts.init(document.getElementById('main'), null, { |
| |
| }); |
| |
| var data1 = []; |
| var data2 = []; |
| |
| for (var i = 0; i < 5; i++) { |
| data1.push([ |
| i * 5, i * 4, i * 20, |
| Math.random() * 10 |
| ]); |
| data2.push([ |
| i * 5, 30, (Math.random() - 0.5) * 100 |
| ]) |
| } |
| |
| chart.setOption({ |
| grid: { |
| top: '26%', |
| bottom: '26%' |
| }, |
| xAxis: { |
| type: 'value', |
| splitLine: { |
| show: false |
| } |
| }, |
| yAxis: { |
| type: 'value', |
| splitLine: { |
| show: false |
| } |
| }, |
| visualMap: [ |
| { |
| show: true, |
| splitNumber: 7, |
| selectedMode: 'multiple', |
| backgroundColor: '#eee', |
| dimension: 3, |
| seriesIndex: 0, |
| max: 10, |
| color: ['red', 'pink', 'black'], |
| itemSymbol: 'circle' |
| }, |
| { |
| right: 0, |
| splitNumber: 3, |
| max: 10, |
| selectedMode: 'multiple', |
| dimension: 3, |
| seriesIndex: 0, |
| backgroundColor: '#eee', |
| inRange: { |
| symbol: ['rect', 'line', 'path://M 100 100 L 300 100 L 200 300 z'] |
| }, |
| itemSymbol: 'diamond' |
| }, |
| { |
| left: 'center', |
| min: -50, |
| max: 50, |
| dimension: 2, |
| seriesIndex: 1, |
| backgroundColor: '#eee', |
| pieces: [ |
| { |
| lt: 0, |
| color: 'red', |
| symbol: 'path://M 100 100 L 300 100 L 200 300 z' |
| }, |
| { |
| gte: 0, |
| color: 'green', |
| // symbol: 'rect' |
| } |
| ], |
| itemSymbol: 'circle' |
| } |
| ], |
| series: [ |
| { |
| name: 'scatter', |
| type: 'scatter', |
| symbolSize: 40, |
| data: data1 |
| }, |
| { |
| type: 'scatter', |
| symbolSize: 60, |
| data: data2 |
| } |
| ] |
| }); |
| }) |
| |
| </script> |
| </body> |
| </html> |