| <html> |
| <head> |
| <meta charset="utf-8"> |
| <script src="lib/esl.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> |
| |
| var echarts; |
| var data; |
| |
| require([ |
| 'echarts' |
| ], function (ec) { |
| echarts = ec; |
| echarts && data && init(); |
| }); |
| |
| $.getJSON('./data/house-price-area2.json', function (d) { |
| data = d; |
| echarts && data && init(); |
| }); |
| |
| function init() { |
| 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> |
| |
| |
| |