最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery插件Echarts實現(xiàn)的雙軸圖效果示例【附demo源碼下載】

 更新時間:2017年03月04日 10:26:47   作者:翱翔天地  
這篇文章主要介紹了jQuery插件Echarts實現(xiàn)的雙軸圖效果,結(jié)合完整實例形式分析了Echarts插件制作雙軸圖效果的操作步驟與相關(guān)實現(xiàn)技巧,并附帶demo源碼供讀者下載參考,需要的朋友可以參考下

本文實例講述了jQuery插件Echarts實現(xiàn)的雙軸圖效果。分享給大家供大家參考,具體如下:

1、問題描述:

利用Echarts制作一個折線圖,條件是:三條折線,一條代表可利用率,另外兩條代表數(shù)量。

2、實現(xiàn)源碼:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>echarts-雙軸圖</title>
    <script type="text/javascript" src="jquery-1.4.2.min.js" ></script>
    <script type="text/javascript" src="echarts.js" ></script>
    <style>
      body,html{
        width: 99%;
        height: 99%;
        font-family: "微軟雅黑";
        font-size: 12px;
      }
      #double{
        width: 100%;
        height: 100%;
        font-family: "agency fb";
        font-weight: bolder;
      }
    </style>
    <script>
      $(function(){
        var chart = document.getElementById('double');
        var echart = echarts.init(chart);
        var option = {
          title : {
            text: '可利用率',
            subtext: '',
            x: 'center',
            align: 'right'
          },
          grid: {
            bottom: 80
          },
          tooltip : {
            trigger: 'axis',
            axisPointer: {
              animation: false
            },
            formatter: function (params) {
              var res = params[0].name;
              for (var i = 0, l = params.length; i < l; i++)
              {
                if(i==0)
                {
                  res += '<br/>' + params[i].seriesName + ' : ' + params[i].value + "%";
                }
                else
                {
                  res += '<br/>' + params[i].seriesName + ' : ' + params[i].value;
                }
              }
              return res;
            }
          },
          legend: {
            data:['可利用率','A','B'],
            x: 'left'
          },
          xAxis : [
            {
              type : 'category',
              axisLabel: {
                rotate: 45
              },
              boundaryGap : false,
              axisLine: {onZero: false},
              data : ['2016年1月', '2016年2月', '2016年3月', '2016年4月', '2016年5月','2016年6月','2016年7月','2016年8月','2016年9月','2016年10月','2016年11月','2016年12月'].map(function (str) {
                return str.replace(' ', '\n')
              })
            }
          ],
          yAxis: [
            {
              name: '可利用率',
              type: 'value',
              max: 100,
              axisLabel: {
               show: true,
               interval: 'auto',
               formatter: '{value} %'
              }
            },
            {
              name: 'A',
              nameLocation: 'start',
              type: 'value',
              inverse: true
            },
            {
              name: 'B',
              nameLocation: 'start',
              type: 'value',
              inverse: true
            }
          ],
          series: [
            {
              name:'可利用率',
              type:'line',
              hoverAnimation: false,
              itemStyle: {
                normal: {
                  label : {
                    show:false,
                    position:'top',
                    formatter:'{c} %'
                  }
                }
              },
              areaStyle: {
                normal: {}
              },
              lineStyle: {
                normal: {
                  width: 1
                }
              },
              data:[12,78,34,67,88,45,65,77,31,21,90,54]
            },
            {
              name:'A',
              type:'line',
              yAxisIndex:1,
              hoverAnimation: false,
              areaStyle: {
                normal: {}
              },
              lineStyle: {
                normal: {
                  width: 1
                }
              },
              data: [1,4,5,8,3,2,7,6,9,2,4,3]
            },
            {
              name:'B',
              type:'line',
              yAxisIndex:1,
              hoverAnimation: false,
              areaStyle: {
                normal: {}
              },
              lineStyle: {
                normal: {
                  width: 1
                }
              },
              data: [0,2,3,7,1,0,5,2,6,1,2,1]
            }
          ]
        };
        echart.setOption(option);
      });
    </script>
  </head>
  <body>
    <div id="double"></div>
  </body>
</html>

3、實現(xiàn)效果圖:

附:完整實例代碼點擊此處本站下載

更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery常用插件及用法總結(jié)》、《jquery中Ajax用法總結(jié)》、《jQuery表格(table)操作技巧匯總》、《jQuery擴展技巧總結(jié)》、《jQuery常見經(jīng)典特效匯總》及《jquery選擇器用法總結(jié)

希望本文所述對大家jQuery程序設(shè)計有所幫助。

相關(guān)文章

最新評論

遂平县| 高阳县| 淳化县| 东光县| 阿鲁科尔沁旗| 东乡县| 汉寿县| 上饶县| 七台河市| 南康市| 疏勒县| 腾冲县| 利川市| 呼和浩特市| 张家港市| 东海县| 孟村| 沙雅县| 长沙市| 大方县| 莱州市| 山阴县| 洛川县| 东港市| 郁南县| 太仆寺旗| 石嘴山市| 贞丰县| 涞源县| 寿光市| 宜宾市| 阿合奇县| 沐川县| 手机| 涪陵区| 微山县| 西昌市| 昌江| 罗城| 崇阳县| 湘阴县|