|  | 
 | <!-- | 
 | 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> | 
 |         <script src="lib/facePrint.js"></script> | 
 |         <script src="lib/testHelper.js"></script> | 
 |         <meta name="viewport" content="width=device-width, initial-scale=1" /> | 
 |     </head> | 
 |     <body> | 
 |         <style> | 
 |             h1 { | 
 |                 line-height: 60px; | 
 |                 height: 60px; | 
 |                 background: #146402; | 
 |                 text-align: center; | 
 |                 font-weight: bold; | 
 |                 color: #eee; | 
 |                 font-size: 14px; | 
 |             } | 
 |             .chart { | 
 |                 height: 600px; | 
 |             } | 
 |         </style> | 
 |  | 
 |         <div id="main" class="chart"></div> | 
 |         <script> | 
 |  | 
 |         require(['echarts'], | 
 |             function (echarts) { | 
 |  | 
 |                 var chart = echarts.init(document.getElementById('main')); | 
 |  | 
 |                 chart.setOption({ | 
 |                     aria: { | 
 |                         enabled: true, | 
 |                         series: { | 
 |                             multiple: { | 
 |                                 prefix: '{seriesCount}个图表系列组成了该图表。' | 
 |                             } | 
 |                         } | 
 |                     }, | 
 |                     tooltip : { | 
 |                         trigger: 'axis', | 
 |                         axisPointer : {            // 坐标轴指示器,坐标轴触发有效 | 
 |                             type : 'shadow'        // 默认为直线,可选为:'line' | 'shadow' | 
 |                         } | 
 |                     }, | 
 |                     legend: { | 
 |                         data:['热度', '正面', '负面'] | 
 |                     }, | 
 |                     grid: { | 
 |                         left: '3%', | 
 |                         right: '4%', | 
 |                         bottom: '3%', | 
 |                         containLabel: true | 
 |                     }, | 
 |                     xAxis : [ | 
 |                         { | 
 |                             type : 'value' | 
 |                         } | 
 |                     ], | 
 |                     yAxis : [ | 
 |                         { | 
 |                             type : 'category', | 
 |                             axisTick : {show: false}, | 
 |                             data : ['汽车之家','今日头条','百度贴吧','一点资讯','微信','微博','知乎'] | 
 |                         } | 
 |                     ], | 
 |                     series : [ | 
 |                         { | 
 |                             name:'热度', | 
 |                             type:'bar', | 
 |                             label: { | 
 |                                 normal: { | 
 |                                     show: true, | 
 |                                     position: 'inside' | 
 |                                 } | 
 |                             }, | 
 |                             data:[300, 270, 340, 344, 300, 320, 310] | 
 |                         }, | 
 |                         { | 
 |                             name:'正面', | 
 |                             type:'bar', | 
 |                             stack: '总量', | 
 |                             label: { | 
 |                                 normal: { | 
 |                                     show: true | 
 |                                 } | 
 |                             }, | 
 |                             data:[120, 102, 141, 174, 190, 250, 220] | 
 |                         }, | 
 |                         { | 
 |                             name:'负面', | 
 |                             type:'bar', | 
 |                             stack: '总量', | 
 |                             label: { | 
 |                                 normal: { | 
 |                                     show: true, | 
 |                                     position: 'left' | 
 |                                 } | 
 |                             }, | 
 |                             data:[-20, -32, -21, -34, -90, -130, -110] | 
 |                         } | 
 |                     ] | 
 |                 }); | 
 |  | 
 |                 window.onresize = chart.resize; | 
 |             } | 
 |         ); | 
 |         </script> | 
 |     </body> | 
 | </html> |