|  |  | 
|  | <!-- | 
|  | 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> | 
|  | <meta name="viewport" content="width=device-width, initial-scale=1" /> | 
|  | <link rel="stylesheet" href="lib/reset.css"> | 
|  | </head> | 
|  | <body> | 
|  | <style> | 
|  | .chart { | 
|  | width: 100%; | 
|  | height: 600px; | 
|  | } | 
|  | h2 { | 
|  | text-align: center; | 
|  | font-size: 16px; | 
|  | line-height: 30px; | 
|  | font-weight: normal; | 
|  | color: #eee; | 
|  | background: #333; | 
|  | } | 
|  | .foot { | 
|  | font-size: 12px; | 
|  | color: #999; | 
|  | text-align: center; | 
|  | } | 
|  | </style> | 
|  |  | 
|  | <h2></h2> | 
|  | <div class="chart" id="main0"></div> | 
|  |  | 
|  | <div class="foot"> | 
|  | Thanks to: 若怀冰 <br> | 
|  | http://gallery.echartsjs.com/explore.html?u=bd-16906679 <br> | 
|  | http://gallery.echartsjs.com/editor.html?c=xHJw-hVqjW | 
|  | </div> | 
|  |  | 
|  |  | 
|  | <script> | 
|  |  | 
|  | require([ | 
|  | 'echarts', | 
|  | './data/house-price-area2.json' | 
|  | ], function (echarts, data) { | 
|  | var el = document.getElementById('main0'); | 
|  | var chart = echarts.init(el); | 
|  |  | 
|  | var option = { | 
|  | title: { | 
|  | text: 'Dispersion of house price based on the area', | 
|  | left: 'center', | 
|  | top: 0 | 
|  | }, | 
|  | visualMap: { | 
|  | min: 15202, | 
|  | max: 159980, | 
|  | dimension: 1, | 
|  | orient: 'vertical', | 
|  | right: 10, | 
|  | top: 'center', | 
|  | text: ['HIGH', 'LOW'], | 
|  | calculable: true, | 
|  | inRange: { | 
|  | color: ['#f2c31a', '#24b7f2'] | 
|  | } | 
|  | }, | 
|  | tooltip: { | 
|  | trigger: 'item', | 
|  | axisPointer: { | 
|  | type: 'cross' | 
|  | } | 
|  | }, | 
|  | xAxis: [{ | 
|  | type: 'value' | 
|  | }], | 
|  | yAxis: [{ | 
|  | type: 'value' | 
|  | }], | 
|  | series: [{ | 
|  | name: 'price-area', | 
|  | type: 'scatter', | 
|  | symbolSize: 5, | 
|  | // itemStyle: { | 
|  | //     normal: { | 
|  | //         borderWidth: 0.2, | 
|  | //         borderColor: '#fff' | 
|  | //     } | 
|  | // }, | 
|  | data: data | 
|  | }] | 
|  | }; | 
|  |  | 
|  | chart.setOption(option); | 
|  | }); | 
|  |  | 
|  | </script> | 
|  |  | 
|  | </body> | 
|  | </html> | 
|  |  | 
|  |  | 
|  |  |