zoukankan      html  css  js  c++  java
  • js双轴柱状图

    <!doctype html>
    <html lang="en">
    <head>
    <script type="text/javascript" src="js/httpcdn.hcharts.cnjqueryjquery-1.8.3.min.js"></script>  //http://www.hcharts.cn/demo/index.php?p=27 有对应的js
    <script type="text/javascript" src="js/httpcdn.hcharts.cnhighchartshighcharts.js"></script>     //http://www.hcharts.cn/demo/index.php?p=27 有对应的js
    <script type="text/javascript" src="js/httpcdn.hcharts.cnhighchartsexporting.js"></script>      //http://www.hcharts.cn/demo/index.php?p=27 有对应的js
    <script>
    //左侧Javascript代码
    $(function () {
    $('#container').highcharts({

    chart: {
    type: 'column'
    },

    title: {
    text: '源客户数、新创建客户数'
    },

    xAxis: {
    //tickInterval: 1
    categories: ['电商系统', 'SCRM系统', 'vivo帐户系统', '电子保卡系统'],
    title: {
    text: null
    }
    },

    yAxis: [{
    type: 'logarithmic',
    minorTickInterval: 1,
    title: {
    text: '新建比率' ,
    style: {
    color: '#666666'
    }
    },
    labels: {
    format: '{value} %',
    style: {
    color: '#666666'
    }
    }
    },
    { // Secondary yAxis
    title: {
    text: '源客户数 人' ,
    style: {
    color: '#4572A7'
    }
    },
    labels: {
    format: '{value} 人',
    style: {
    color: '#4572A7'
    }
    },
    opposite: true
    }],

    tooltip: {
    shared: true,
    //headerFormat: '<b>{series.name}</b><br />',
    //pointFormat: 'x = {point.x}, y = {point.y}'
    },

    series: [
    {
    name: '源客户数(人)',
    color: '#4572A7',
    type: 'column',
    yAxis: 1,
    data: [20000,50000,80000,30000],
    tooltip: {
    valueSuffix: ' 人'
    }

    },
    {
    name: '新建比率(%)',
    color: '#666666',

    data: [50.00,80.00,37.50,3.33],
    pointStart: 0,
    tooltip: {
    valueSuffix: ' %'
    },

    //type: 'spline',   //折线图
    type: 'column',   //柱形图
    marker: {
    lineWidth: 2,
    lineColor: Highcharts.getOptions().colors[3],
    fillColor: 'white' }
    }
    //{
    // data: [0, 2, 4, 8, 16, 32, 64],
    // pointStart: 0
    //},
    ]
    });
    });
    </script>
    </head>
    <body>
    <div id="container" style="min-700px;height:400px"></div>
    </body>
    </html>

  • 相关阅读:
    C++防止头文件反复包括
    yppasswd, ypchfn, ypchsh
    yes
    Yacc
    xxd
    xpdf -Portable Document Format(PDF)文件阅读器
    xinetd
    xargs
    x25, PF_X25
    write -在一个文件描述符上执行写操作
  • 原文地址:https://www.cnblogs.com/zigewb/p/4549795.html
Copyright © 2011-2022 走看看