87Echarts - 散点图(Visual interaction with stream)

简介: 87Echarts - 散点图(Visual interaction with stream)
效果图

源代码
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>ECharts</title>
    <!-- 引入 echarts.js -->
    <script src="js/echarts.min.js"></script>
  </head>
  <body>
    <!-- 为ECharts准备一个具备大小(宽高)的Dom -->
    <div id="main" style="width: 600px;height:400px;"></div>
    <script type="text/javascript">
      // 基于准备好的dom,初始化echarts实例
      var myChart = echarts.init(document.getElementById('main'));
      var option;
      $.getJSON('data/asset/data/house-price-area2.json', function (data) {
          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
              }]
          };
      myChart.setOption(option);
    </script>
  </body>
</html>
目录
相关文章
105Echarts - K 线图(Basic Candlestick)
105Echarts - K 线图(Basic Candlestick)
64 0
72Echarts - 散点图(Clustering Process)
72Echarts - 散点图(Clustering Process)
97 0
230Echarts - 3D 柱状图(Music Visualization)
230Echarts - 3D 柱状图(Music Visualization)
49 0
108Echarts - 雷达图(Basic Radar Chart)
108Echarts - 雷达图(Basic Radar Chart)
44 0
11Echarts - 折线图(Rainfall and Water Flow)
11Echarts - 折线图(Rainfall and Water Flow)
51 0
163Echarts - 桑基图(Basic Sankey)
163Echarts - 桑基图(Basic Sankey)
74 0
110Echarts - 雷达图(Customized Radar Chart)
110Echarts - 雷达图(Customized Radar Chart)
43 0
04Echarts - 折线图(Basic area chart)
04Echarts - 折线图(Basic area chart)
38 0
03Echarts - 折线图(Basic Line Chart)
03Echarts - 折线图(Basic Line Chart)
43 0
22Echarts - 折线图(Distribution of Electricity)
22Echarts - 折线图(Distribution of Electricity)
27 0