zoukankan      html  css  js  c++  java
  • highCharts 实现多级下钻功能

    <!DOCTYPE html>
    <html lang="zh">
      <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <meta http-equiv="x-ua-compatible" content="ie=edge" />
        <link
          rel="icon"
          href="https://static.jianshukeji.com/hcode/images/favicon.ico"
        />
        <script src="https://code.highcharts.com.cn/jquery/jquery-1.8.3.min.js"></script>
        <script src="https://code.highcharts.com.cn/highcharts/highcharts.js"></script>
        <script src="https://code.highcharts.com.cn/highcharts/modules/drilldown.js"></script>
        <script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
      </head>
      <body>
        <div
          id="container"
          style="min- 310px; height: 400px; margin: 0px auto; overflow: hidden;"
        ></div>
        <script>
          $('#container').highcharts({
            chart: {
              type: 'column'
            },
            title: {
              text: 'Basic drilldown'
            },
            xAxis: {
              type: 'category'
            },
            legend: {
              enabled: false
            },
            plotOptions: {
              series: {
                borderWidth: 0,
                dataLabels: {
                  enabled: true
                }
              }
            },
            series: [
              {
                name: 'Things',
                colorByPoint: true,
                data: [
                  {
                    name: 'Animals',
                    y: 5,
                    drilldown: 'animals'
                  },
                  {
                    name: 'Fruits',
                    y: 2,
                    drilldown: 'fruits'
                  },
                  {
                    name: 'Cars',
                    y: 4,
                    drilldown: 'cars'
                  }
                ]
              }
            ],
            drilldown: {
              series: [
                {
                  id: 'animals',
                  data: [
                    ['Cats', 4],
                    ['Dogs', 2],
                    ['Cows', 1],
                    ['Sheep', 2],
                    ['Pigs', 1]
                  ]
                },
                {
                  id: 'fruits',
                  data: [
                    ['Apples', 4],
                    {
                      name: 'Oranges',
                      y: 2,
                      drilldown: 'third-leves'
                    }
                  ]
                },
                {
                  id: 'cars',
                  data: [['Toyota', 4], ['Opel', 2], ['Volkswagen', 2]]
                },
                {
                  id: 'third-leves',
                  data: [
                    ['Toyota', 4],
                    ['Opel', 2],
                    { name: 'Volkswagen', y: 2, drilldown: 'ttt' }
                  ]
                },
                {
                  id: 'ttt',
                  data: [['x', 1], ['xx', 2], ['xxx', 3]]
                }
              ]
            }
          });
        </script>
      </body>
    </html>
    
    
  • 相关阅读:
    Navsion二次开发_学习笔记
    《软件开发者路线图:从学徒到高手》笔记
    Concurrency并发性
    Excel VBA 函数
    在excel worksheet中添加button 和对Excel workbook做权限控制相关的新知识
    outline (group) 在Excel worksheet 中
    自主学习进度(软件工程)
    四则运算实现2(JAVA)
    简单四则运算实现(JAVA)
    数学建模(Lingo)(非线性整数规划)
  • 原文地址:https://www.cnblogs.com/yzyh/p/11446318.html
Copyright © 2011-2022 走看看