国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

jQuery插件Echarts實(shí)現(xiàn)的漸變色柱狀圖

2019-11-19 17:04:04
字體:
供稿:網(wǎng)友

效果圖:

代碼如下:

<!DOCTYPE html><html><head>  <meta charset="utf-8">  <title>ECharts柱狀圖</title>  </head><body>  <!-- 為ECharts準(zhǔn)備一個(gè)具備大小(寬高)的Dom -->  <div id="container" style="width: 600px;height:400px; margin: 100px auto 20px;"></div>  <script typet="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>  <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts-all-3.js"></script>   <script type="text/javascript">    var dom = document.getElementById("container");    var myChart = echarts.init(dom);    option = null;        var xAxisData = [];    var data = [];    for (var i = 20; i < 29; i++) {      xAxisData.push('2' +'/'+ i);      data.push(Math.round(Math.random() * 500) + 200);    }    // 初始 option    option = {      title: {        text: '每日成交額(萬元)'      },      tooltip: {        trigger: 'axis',                borderColor: '#636F7F',        borderWidth : 1,        backgroundColor : 'rgba(99,111,127,1)',        textStyle:{          color : '#ffffff',          // fontWeight : 'bold',          fontSize : 14,          },        transitionDuration : 0.6,                formatter: '{b0}<br />{c0}(萬元)',                axisPointer :{          type : 'line',          lineStyle : {            color : '#05F41E',            width : 1,            type : 'solid',          },        },        // axisPointer : {      // 坐標(biāo)軸指示器,坐標(biāo)軸觸發(fā)有效        //   type : 'shadow',    // 默認(rèn)為直線,可選為:'line' | 'shadow'        //   shadowStyle :{        //     color : '#D6EAFA',        //     opacity : 0.5,        //   }        // },      },      calculable : true,      xAxis: {        data: xAxisData.map(function(x){          return x;                  }),        axisLabel: {          textStyle: {            color: '#333',            align : 'center',            baseline : 'top'          },          rotate : 20,          margin : 15,        },      },       yAxis: {                // 橫向標(biāo)線 默認(rèn)為TRUE        splitLine: {          show: true,        },        axisLabel: {          textStyle: {            color: '#333'          }        },        type : 'value',        boundaryGap : false,        // 分隔線線的類型        splitLine: {          show: true,          lineStyle :{            color : '#EFF0F0',            type : 'dashed',          }        }      },      series: {        type: 'bar',        data: data,        barWidth: 15,        itemStyle: {          normal: {            barBorderRadius: 20,            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{              offset: 0,              color: '#37BBF8'            }, {              offset: 1,              color: '#2294E4'            }]),            // shadowColor: 'rgba(35,149,229,0.8)',            // shadowBlur: 20,            areaStyle: {type: 'default'}          }        }      },          };    if (option && typeof option === "object") {      myChart.setOption(option, true);    }  </script></body></html>

以上就是本文的全部內(nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來一定的幫助,同時(shí)也希望多多支持武林網(wǎng)!

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 惠州市| 芜湖县| 于田县| 富蕴县| 芒康县| 和林格尔县| 北安市| 桐柏县| 杭锦旗| 三明市| 平原县| 荔浦县| 方山县| 武清区| 西贡区| 五家渠市| 贺州市| 德庆县| 霍州市| 武功县| 蓝山县| 灵丘县| 延川县| 丹阳市| 安化县| 新沂市| 新民市| 固始县| 夏津县| 泰安市| 徐汇区| 枞阳县| 泰顺县| 平和县| 宝应县| 都江堰市| 临江市| 临朐县| 红安县| 天峨县| 黄山市|