174Echarts - 象形柱图(Wish List and Mountain Height)

简介: 174Echarts - 象形柱图(Wish List and Mountain Height)
效果图

源代码
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>ECharts</title>
    <!-- 引入 echarts.js -->
    <script src="js/echarts.min.js"></script>
    <script src="js/jquery-1.11.0.min.js"></script>
    <script src="dist/extension/dataTool.js"></script>
  </head>
  <body>
    <!-- 为ECharts准备一个具备大小(宽高)的Dom -->
    <div id="main" style="width: 1024px;height:768px;"></div>
    <script type="text/javascript">
      // 基于准备好的dom,初始化echarts实例
      var myChart = echarts.init(document.getElementById('main'));
      var option;
      var paperDataURI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAAAyCAYAAACgRRKpAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAB6FJREFUeNrsnE9y2zYYxUmRkig7spVdpx3Hdqb7ZNeFO2PdoD1Cj9DeoEdKbmDPeNFNW7lu0y7tRZvsYqfjWhL/qPgggoIggABIQKQkwsOhE5sQCfzw3uNHJu5sNnOaZq29RttolwfAbxgwChO9nad//4C2C7S9Sfe3uzQobqNghdoJBdIw3R8qHnvNANcA1sBUGCaV9pYC7rYBbLvbgAFpaBgmWbujlO1NA9h2wQTbcdHOoih2ZujLa7WcFtoMtUsKuFEDWL3bkAHq2GTnT+OJkyTzsXRd1/G8FoYN9vBnQ+pGZ7f7BrDqYSLbq6IdxXGM96BKIlBgDP97mgj7aLXcDLa8fgqoGwFu1ABmvzwwLAuTTJmw/SFIfG/ZBmEMIwRiHCVOnCTSPkk/BDoD7YHJbvcNYOVgYmtNWo1cs0xJ8pQJDgXIfM9bscE4TrDyAWwETuEEpP0QSzWU365T0CpXtzoDdsJY3bmpjqfT0AlRKMfWhQBhFYkGLAwjpE6JIxsnAAz6YW0QjksQaBGGTq0fw/mt0kJvXQA7cezWmpYaqBJ73XmKREABQMAKARjZsOXZqU4/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jr4KEYFAYRSF2YrrBkEGnGoznduKK5FefUwZ4Ja8rKJbBIV+QZVEi4LuC97776HFb8vqZEARmACkAPPRzVvMl+j3/fH8oCA9oWQOWhg603DqPNx/xAMKPwcb9f18hYITef/+g7XcRkJ9R6JEvFDPUwxsXchuiOXkATxf7TEuAMvKKnSIXla31bwF/eYpEhvIpUFc0+pIg3mnoaKszjk8PMQw+b7ev9VeKVOIPjicTtBkRXiAADQATvUh9Lpym+n6mJaVpiUBmZXy8lbRIJ7d0WlanQgogIlYXRGYqCLrBdkAsB/RN987Gu9kgY3CyUGA1Mlq68ptNupjOnd9vaCj/OhF/fVtJ81Mi2ymX+yOMqCgHwCIQAX7ElX7DKj9vWDpIXj2LPLm93ffoh3Z1vmPTa3nNtU7NNW3NvLKKnAMhPDSCyRVpUVRdVYYKAImXBsTwo0DtTKmvBOvEjbb9TZdK8X5TOEOkpQr3DSwF7E6+u6ubAOHgQVQEiZtoJQA48A2TGE7XidstnObqpUG3bZW3tSxOs7jlapbKaC0AWNgg1d4vqsCtnXkNtFbG2XqTjqPVypqdwxQtyY7L/xGa9Ww2c5txPZgeDptX/mY7E2CWbEgvulAGQOsTrDZzm1Cq8t/k2AngbICWJ1gs5Xbij5e2TWgrAPGwHaSggbAvariAovktjKPV3YdqLUCVjfYeLmt6JsEDVA1A6xusEFue/HiuM5Wt5FA1QKwusD28uXLBqhtB0wAG2znOwLYVgFVa8AY2AYUbN9sEWBbDdTGALYO2NYE2E4BtZGA2YLNEmA7DdTGA2YSttPT04nrut0GqAYwVdiGjsZrRkdHR3ftdlv3aQP9/zA0QO0KYBzgpO+0KQL2wCjUqMGmAUwJNgFgDVANYGZgQ4DdI8AGDVANYFba3/98+PqLzz+7ajCw1/4XYABXWBExzrUA+gAAAABJRU5ErkJggg==';
      option = {
        backgroundColor: '#0f375f',
        tooltip: {},
        legend: {
          data: ['all'],
          textStyle: {
            color: '#ddd'
          }
        },
        xAxis: [{
          data: ['圣诞节儿童愿望清单', '', '珠穆朗玛\nQomolangma', '乞力马扎罗\nKilimanjaro'],
          axisTick: {
            show: false
          },
          axisLine: {
            show: false
          },
          axisLabel: {
            margin: 20,
            textStyle: {
              color: '#ddd',
              fontSize: 14
            }
          }
        }],
        yAxis: {
          splitLine: {
            show: false
          },
          axisTick: {
            show: false
          },
          axisLine: {
            show: false
          },
          axisLabel: {
            show: false
          }
        },
        markLine: {
          z: -1
        },
        animationEasing: 'elasticOut',
        series: [{
          type: 'pictorialBar',
          name: 'all',
          hoverAnimation: true,
          label: {
            normal: {
              show: true,
              position: 'top',
              formatter: '{c} m',
              textStyle: {
                fontSize: 16,
                color: '#e54035'
              }
            }
          },
          data: [{
            value: 13000,
            symbol: 'image://' + paperDataURI,
            symbolRepeat: true,
            symbolSize: ['130%', '20%'],
            symbolOffset: [0, 10],
            symbolMargin: '-30%',
            animationDelay: function(dataIndex, params) {
              return params.index * 30;
            }
          }, {
            value: '-',
            symbol: 'none',
          }, {
            value: 8844,
            symbol: 'image://./data/asset/img/hill-Qomolangma.png',
            symbolSize: ['200%', '105%'],
            symbolPosition: 'end',
            z: 10
          }, {
            value: 5895,
            symbol: 'image://./data/asset/img/hill-Kilimanjaro.png',
            symbolSize: ['200%', '105%'],
            symbolPosition: 'end'
          }],
          markLine: {
            symbol: ['none', 'none'],
            label: {
              normal: {
                show: false
              }
            },
            lineStyle: {
              normal: {
                color: '#e54035',
                width: 2
              }
            },
            data: [{
              yAxis: 8844
            }]
          }
        }, {
          name: 'all',
          type: 'pictorialBar',
          barGap: '-100%',
          symbol: 'circle',
          itemStyle: {
            normal: {
              color: '#185491'
            }
          },
          silent: true,
          symbolOffset: [0, '50%'],
          z: -10,
          data: [{
            value: 1,
            symbolSize: ['150%', 50]
          }, {
            value: '-'
          }, {
            value: 1,
            symbolSize: ['200%', 50]
          }, {
            value: 1,
            symbolSize: ['200%', 50]
          }]
        }]
      };
      myChart.setOption(option);
    </script>
  </body>
</html>
目录
相关文章
172Echarts - 象形柱图(Dotted bar)
172Echarts - 象形柱图(Dotted bar)
55 0
172Echarts - 象形柱图(Dotted bar)
|
2月前
|
XML 前端开发 数据格式
echarts柱图前后端代码SpringCloud+Vue3
echarts柱图前后端代码SpringCloud+Vue3
61 1
|
JavaScript 数据可视化 前端开发
漏刻有时数据可视化Echarts组件开发(21):基于echarts开发的自动旋转map3D下钻和柱图地图
漏刻有时数据可视化Echarts组件开发(21):基于echarts开发的自动旋转map3D下钻和柱图地图
276 1
|
数据可视化
2019-nCov疫情实时趋势数据可视化Echarts学习(1):柱图和折线图
2019-nCov疫情实时趋势数据可视化Echarts学习(1):柱图和折线图
98 0
177Echarts - 象形柱图(Velocity of Christmas Reindeers)
177Echarts - 象形柱图(Velocity of Christmas Reindeers)
37 0
176Echarts - 象形柱图(Vehicles)
176Echarts - 象形柱图(Vehicles)
34 0
175Echarts - 象形柱图(Spirits)
175Echarts - 象形柱图(Spirits)
76 0
173Echarts - 象形柱图(Expansion of forest)
173Echarts - 象形柱图(Expansion of forest)
50 0
171Echarts - 象形柱图(Water Content)
171Echarts - 象形柱图(Water Content)
34 0
88Echarts - 散点图(Distribution of Height and Weight)
88Echarts - 散点图(Distribution of Height and Weight)
36 0

热门文章

最新文章