123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <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>
|