zoukankan      html  css  js  c++  java
  • HighCharts之2D数值带有百分数的面积图

    HighCharts之2D数值带有百分数的面积图


    1、HighCharts之2D数值带有百分数的面积图源码

    AreaPercentage.html:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>HighCharts 2D数值带有百分数的面积图</title>
    <script type="text/javascript" src="../scripts/jquery-1.11.0.js"></script>
    <script type="text/javascript" src="../scripts/js/highcharts.js"></script>
    <script type="text/javascript">
         $(function(){
        	 $('#percentageAreaChart').highcharts({
        		 chart: {
                     type: 'area'
                 },
                 title: {
                     text: '2013年水果销售量'
                 },
                 subtitle: {
                     text: '水果销量'
                 },
                 xAxis: {
                     categories: ['一月', '二月', '三月', '四月', '五月', '六月', '七月','八月','九月','十月','十一月','十二月'],
                     tickmarkPlacement: 'on',
                     title: {
                         enabled: true
                     }
                 },
                 yAxis: {
                     title: {
                         text: '百分比(%)'
                     }
                 },
                 tooltip: {
                     pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.percentage:.1f}%</b> ({point.y:,.0f} kg)<br/>',
                     shared: true
                 },
                 plotOptions: {
                     area: {
                         stacking: 'percent',
                         lineColor: '#ffffff',
                         lineWidth: 1,
                         marker: {
                             lineWidth: 1,
                             lineColor: '#ffffff'
                         }
                     }
                 },
                 series: [{
                     name: '苹果',
                     data: [561, 145, 365, 879, 1245, 345, 268,654,945,451,615,341]
                 }, {
                     name: '梨子',
                     data: [306, 207, 451, 654, 354, 245, 874,652,478,984,875,243]
                 }, {
                     name: '橘子',
                     data: [156, 421, 214, 754, 410, 623, 894,451,652,874,356,524]
                 }, {
                     name: '荔枝',
                     data: [851, 331, 554, 245, 439, 718, 245,653,451,698,321,684]
                 }, {
                     name: '草莓',
                     data: [245, 352, 852, 746, 313, 430, 246,895,675,235,654,745]
                 }]
             });
         });
    </script>
    </head>
    <body>
       <div id="percentageAreaChart" style=" 1200px; height: 500px; margin: 0 auto"></div>
    </body>
    </html>

    2、运行结果


  • 相关阅读:
    六、Linux计划任务及压缩归档
    四、用户管理
    三、vim编辑器详解
    八、RAID磁盘阵列及CentOS7系统启动流程
    五、权限管理
    二、Linux常用命令
    七、Linux磁盘管理及LVM讲解
    一、Linux常用命令
    JS继承的实现方式 原型 原型链 prototype和_proto_的区别
    js引用类型(Object、Array)
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13315268.html
Copyright © 2011-2022 走看看