可视化平台项目

1. 案例介绍

本案例要基于MySQL数据库,使用Kettle、Apache Superset实现数据可视化。案例使用MySQL作为数据分析的存储以及查询引擎、以Kettle作为数据处理脚本执行工具、以及Apache Superset实现数据可视化展示。让我们将来能够欧快速实现数据分析、以及可视化开发。

2.系统架构

3.ETL概念

kettle 是一款大数据中用于实现数据的ETL工作的工具, 同时也是从事ETL工程师必备项。

ETL是将业务系统的数据经过抽取、清洗转换之后加载到数据仓库的过程,目的是将企业中的分散、零乱、标准不统一的数据整合到一起,为企业的决策提供分析依据, ETL是BI(商业智能)项目重要的一个环节。

  ETL 的流程可以用任何的编程语言去开发完成,由于ETL是极为复杂的过程,而手写程序不易管理,有愈来愈多的企业采用工具协助ETL的开发,并运用其内置的metadata功能来存储来源与目的的对应(mapping)以及转换规则。

工具可以提供较强大的连接功能(connectivity)来连接来源端及目的端,开发人员不用去熟悉各种相异的平台及数据的结构,亦能进行开发。

kettle的安装

环境要求:

  • 安装、配置好JDK

kettle具体使用方法和安装步骤单独发!!!!

4.可视化工具(superset)

Superset是一款开源的现代化企业级BI。它是目前开源的数据分析和可视化工具中比较好用的,功能简单但可以满足我们对数据的基本需求,支持多种数据源,图表类型多,易维护,易进行二次开发。BI可以将数据进行模型构建,制作成Dashboard,相比于报表,侧重点在于分析,操作简单、数据处理量大。常常基于企业搭建的数据平台,连接数据仓库进行分析。

superset的安装

环境要求:

  • Linux系统
  • Python3的环境

superset具体使用方法和安装步骤单独发!!!!

5.基于Kettle实现数据ETL

--  创建一个用于保存分析数据的数据库

create database if not exists itheima_bi;

--  数据抽取,将存储在MySQL中的数据源抽取出来,存储在另一个数据库用来分析

对于数据的更新, 我们可能采用按天抽取, 按小时抽取, 或者按周抽取, 一般来说都是按照天来进行抽取更为稳妥

  • 所有同步到分析库的表名统一以 ods_源表名开头。例如:

    • ods_itheima_areas:行政地理区域表
    • ods_itheima_goods:商品表
  • 所有用于保存分析结果的表名统一以app_主题_分析维度开头。例如:
    • app_order_paytype:针对支付类型的订单分析
    • app_user_order_top5:针对用户的消费订单总额TOP5分析

6.数据分析操作

  • 需求1: 统计 2019-09-05订单支付的总金额、订单的总笔数

    1) 创建分析结果存储表:
    CREATE TABLE IF NOT EXISTS app_order_total(
      id INTEGER AUTO_INCREMENT PRIMARY KEY,
      dt VARCHAR(20),
      total_money DOUBLE,
      total_cnt INTEGER
    );
    ?
    2) 编写测试统计分析语句
    SELECT
        NULL,
        "2019-09-05",
        SUM(realTotalMoney) ,
        COUNT(1) FROM ods_itheima_orders
    WHERE SUBSTRING(createTime,1,10) = "2019-09-05";
    
     3) kettle中加载执行操作
        SQL脚本:
            INSERT INTO app_order_total
            SELECT
                NULL,
                "${dt}",
                SUM(realTotalMoney) ,
                COUNT(1) FROM ods_itheima_orders
            WHERE SUBSTRING(createTime,1,10) = "${dt}";
  • 需求2: 统计2019-09-05当天下过订单的不同用户总数。

    --1)  创建订单用户分析表
    CREATE TABLE IF NOT EXISTS app_order_user(
      id INTEGER  PRIMARY KEY AUTO_INCREMENT,   -- 唯一标识
      dt VARCHAR(50),               -- 统计日期
      total_user_cnt INTEGER            -- 总用户数
    );
    ?
    --2) 编写测试SQL统计分析语句: 统计每日下订单用户数
    SELECT
        NULL,
        "2019-09-05",
        COUNT(DISTINCT userid)
    FROM ods_itheima_orders
    WHERE SUBSTRING(createTime,1,10) = "2019-09-05";
    
    --3) Kettle中加载执行
        SQL脚本:
            -- 加载到分析结果表
            INSERT INTO app_order_user
            SELECT
                NULL,
                "${dt}",
                COUNT(DISTINCT userid)
            FROM ods_itheima_orders
            WHERE SUBSTRING(createTime,1,10) = "${dt}";
  • 需求3: 统计2019-09-05当天,不同的支付方式的订单总额、以及订单总笔数。

    --1) 创建分析表
        CREATE TABLE IF NOT EXISTS app_order_paytype(
              id INTEGER AUTO_INCREMENT PRIMARY KEY,
              dt VARCHAR(20),
              pay_type VARCHAR(20),
              total_money DOUBLE,
              total_cnt INTEGER
        );
    ?
    --2) 编写测试SQL统计分析语句
        SELECT
            NULL,
            "2019-09-05",
            CASE WHEN paytype = 1 THEN ‘支付宝‘
            WHEN paytype = 2 THEN ‘微信‘
            WHEN paytype = 3 THEN ‘现金‘
            ELSE ‘其他‘ END AS paytype,
            SUM(realTotalMoney),
            COUNT(1)
        FROM  ods_itheima_orders
        WHERE SUBSTRING(createTime,1,10) = "2019-09-05"
        GROUP BY paytype
    
    -- 3) kettle 中加载执行
        INSERT INTO app_order_paytype
            SELECT
                NULL,
                "${dt}",
                CASE WHEN paytype = 1 THEN ‘支付宝‘
                WHEN paytype = 2 THEN ‘微信‘
                WHEN paytype = 3 THEN ‘现金‘
                ELSE ‘其他‘ END AS paytype,
                SUM(realTotalMoney),
                COUNT(1)
            FROM  ods_itheima_orders
            WHERE SUBSTRING(createTime,1,10) = "${dt}"
            GROUP BY paytype
  • 需求4: 统计2019年9月下订单最多的用户TOP5,也就是前5名。

    --1) 创建分析表
        CREATE TABLE IF NOT EXISTS app_order_user_top5(
            id INTEGER AUTO_INCREMENT PRIMARY KEY,
            dt VARCHAR(10),
            userid VARCHAR(20),
            username VARCHAR(50),
            total_cnt INTEGER
        );
    
    --2) 编写测试SQL统计分析语句
        SELECT
            NULL,
            "2019-09",
            userid,
            username,
            COUNT(*) total
        FROM ods_itheima_orders  WHERE SUBSTRING(createTime,1,7) = "2019-09"
        GROUP BY  username  ORDER BY total DESC LIMIT 5;
    
    --3) Kettle中加载执行
        INSERT INTO app_order_user_top5
        SELECT
            NULL,
            "${dm}",
            userid,
            username,
            COUNT(*) total
        FROM ods_itheima_orders  WHERE SUBSTRING(createTime,1,7) = "${dm}"
        GROUP BY  username  ORDER BY total DESC LIMIT 5;
  • 需求5 : 统计2019年9月5日当天,不同商品一级分类订单的总金额、订单的总笔数
CREATE TABLE IF NOT EXISTS app_order_goods_cat(
  id INTEGER AUTO_INCREMENT PRIMARY KEY,
  dt VARCHAR(10),
  cat_name VARCHAR(50), -- 一级分类名称
  total_money DOUBLE, -- 订单总金额
  total_num INTEGER -- 订单总笔数
);
创建索引:
    CREATE INDEX idx_ods_itheima_goods_goodsid ON ods_itheima_goods(goodsid);
    CREATE INDEX idx_ods_itheima_goods_cats_catid ON ods_itheima_goods_cats(catid);
相关测试SQL:
SELECT
ogid,orderid,temp4.goodsid ,payprice, temp4.goodscatid , cats2,cats1,ods_itheima_goods_cats.catname,
COUNT(DISTINCT orderid),
SUM(payprice)
FROM
(SELECT
ogid,orderid,temp3.goodsid ,payprice, temp3.goodscatid , cats2,ods_itheima_goods_cats.parentid AS cats1
FROM
(SELECT
ogid,orderid,temp2.goodsid ,payprice, temp2.goodscatid ,ods_itheima_goods_cats.parentid AS cats2
FROM
(SELECT
   ogid,orderid,temp1.goodsid ,payprice, ods_itheima_goods.goodscatid
FROM
(SELECT ogid,orderid,goodsid ,payprice
    FROM ods_itheima_order_goods
 WHERE SUBSTRING(createTime,1,10) = "2019-09-05") temp1 JOIN ods_itheima_goods
ON ods_itheima_goods.goodsid = temp1.goodsid)temp2  JOIN ods_itheima_goods_cats
ON ods_itheima_goods_cats.catid = temp2.goodscatid ) temp3  JOIN ods_itheima_goods_cats
ON ods_itheima_goods_cats.catid = temp3.cats2)temp4 JOIN ods_itheima_goods_cats
ON ods_itheima_goods_cats.catid = cats1
GROUP BY cats1;
?
加载到kettle中运行:
INSERT INTO app_order_goods_cat
SELECT
    NULL,
    "${dt}",
    ods_itheima_goods_cats.catname,
    SUM(payprice),
    COUNT(DISTINCT orderid)
FROM
(SELECT
ogid,orderid,temp3.goodsid ,payprice, temp3.goodscatid , cats2,ods_itheima_goods_cats.parentid AS cats1
FROM
(SELECT
ogid,orderid,temp2.goodsid ,payprice, temp2.goodscatid ,ods_itheima_goods_cats.parentid AS cats2
FROM
(SELECT
   ogid,orderid,temp1.goodsid ,payprice, ods_itheima_goods.goodscatid
FROM
(SELECT ogid,orderid,goodsid ,payprice
    FROM ods_itheima_order_goods
 WHERE SUBSTRING(createTime,1,10) = "${dt}") temp1 JOIN ods_itheima_goods
ON ods_itheima_goods.goodsid = temp1.goodsid)temp2  JOIN ods_itheima_goods_cats
ON ods_itheima_goods_cats.catid = temp2.goodscatid ) temp3  JOIN ods_itheima_goods_cats
ON ods_itheima_goods_cats.catid = temp3.cats2)temp4 JOIN ods_itheima_goods_cats
ON ods_itheima_goods_cats.catid = cats1
GROUP BY cats1;

7.基于superset实现数据可视化数据

--  配置MySQL数据库

  superset-->sources-->database

--  添加需要展示的MySQLapp表

 手动指定,在Superset要将哪些数据进行可视化。

8.组装HTML页面

  1 <!doctype html>
  2 <html lang="en">
  3 <head>
  4     <meta charset="UTF-8">
  5     <meta name="viewport"
  6           content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8     <title>黑马大数据订单分析平台</title>
  9     <link rel="stylesheet" href="./bootstrap/css/bootstrap.min.css">
 10     <style>
 11         body {
 12             background-color: #F5F5F5;
 13             padding: 5px;
 14         }
 15
 16         .col-md-4, .col-md-6, .col-md-12 {
 17             background-color: #F5F5F5;
 18             padding: 5px;
 19         }
 20
 21         .chart {
 22             padding: 16px;
 23             background-color: #ffffff;
 24         }
 25     </style>
 26 </head>
 27 <body>
 28     <div class="container-fluid">
 29         <br/>
 30         <h1 class="text-center"><img src="logo.png" alt="">黑马大数据数据分析平台</h1>
 31         <p class="text-center">研究院大数据研发中心</p>
 32         <br/>
 33         <div class="row">
 34             <div class="col-md-4">
 35                 <div class="chart">
 36                     <!--TODO:导入Superset Chart iFame-->
 37                     <iframe
 38   width="600"
 39   height="300"
 40   seamless
 41   frameBorder="0"
 42   scrolling="no"
 43   src="http://192.168.29.123:8080/superset/explore/?form_data=%7B%22datasource%22%3A%224__table%22%2C%22viz_type%22%3A%22big_number_total%22%2C%22slice_id%22%3A2%2C%22url_params%22%3A%7B%7D%2C%22granularity_sqla%22%3Anull%2C%22time_grain_sqla%22%3A%22P1D%22%2C%22time_range%22%3A%22Last+week%22%2C%22metric%22%3A%7B%22aggregate%22%3A%22SUM%22%2C%22column%22%3A%7B%22column_name%22%3A%22total_money%22%2C%22description%22%3Anull%2C%22expression%22%3Anull%2C%22filterable%22%3Atrue%2C%22groupby%22%3Atrue%2C%22id%22%3A15%2C%22is_dttm%22%3Afalse%2C%22optionName%22%3A%22_col_total_money%22%2C%22python_date_format%22%3Anull%2C%22type%22%3A%22DOUBLE%22%2C%22verbose_name%22%3Anull%7D%2C%22expressionType%22%3A%22SIMPLE%22%2C%22fromFormData%22%3Afalse%2C%22hasCustomLabel%22%3Afalse%2C%22label%22%3A%22SUM%28total_money%29%22%2C%22optionName%22%3A%22metric_vkhs8zu8v6tro_4kpibbtb4337s%22%2C%22sqlExpression%22%3Anull%7D%2C%22adhoc_filters%22%3A%5B%5D%2C%22subheader%22%3A%22%E8%AE%A2%E5%8D%95%E9%94%80%E5%94%AE%E6%80%BB%E9%A2%9D%22%2C%22y_axis_format%22%3A%22.0f%22%2C%22header_font_size%22%3A0.3%2C%22subheader_font_size%22%3A0.125%7D&standalone=true&height=300"
 44 >
 45 </iframe>
 46                 </div>
 47
 48             </div>
 49             <div class="col-md-4">
 50                 <div class="chart">
 51                     <!--TODO:导入Superset Chart iFame-->
 52                      <iframe
 53   width="600"
 54   height="300"
 55   seamless
 56   frameBorder="0"
 57   scrolling="no"
 58   src="http://192.168.29.123:8080/superset/explore/?form_data=%7B%22datasource%22%3A%224__table%22%2C%22viz_type%22%3A%22big_number_total%22%2C%22slice_id%22%3A3%2C%22url_params%22%3A%7B%7D%2C%22granularity_sqla%22%3Anull%2C%22time_grain_sqla%22%3A%22P1D%22%2C%22time_range%22%3A%22Last+week%22%2C%22metric%22%3A%7B%22aggregate%22%3A%22SUM%22%2C%22column%22%3A%7B%22column_name%22%3A%22total_cnt%22%2C%22description%22%3Anull%2C%22expression%22%3Anull%2C%22filterable%22%3Atrue%2C%22groupby%22%3Atrue%2C%22id%22%3A16%2C%22is_dttm%22%3Afalse%2C%22optionName%22%3A%22_col_total_cnt%22%2C%22python_date_format%22%3Anull%2C%22type%22%3A%22INTEGER%2811%29%22%2C%22verbose_name%22%3Anull%7D%2C%22expressionType%22%3A%22SIMPLE%22%2C%22fromFormData%22%3Afalse%2C%22hasCustomLabel%22%3Afalse%2C%22label%22%3A%22SUM%28total_cnt%29%22%2C%22optionName%22%3A%22metric_73robzv9oa8ao_77vm3cqe2ucv7%22%2C%22sqlExpression%22%3Anull%7D%2C%22adhoc_filters%22%3A%5B%5D%2C%22subheader%22%3A%22%E8%AE%A2%E5%8D%95%E6%80%BB%E6%95%B0%22%2C%22y_axis_format%22%3A%22SMART_NUMBER%22%2C%22header_font_size%22%3A0.3%2C%22subheader_font_size%22%3A0.125%7D&standalone=true&height=300"
 59 >
 60 </iframe>
 61
 62                 </div>
 63             </div>
 64             <div class="col-md-4">
 65                 <div class="chart">
 66                     <!--TODO:导入Superset Chart iFame-->
 67                     <iframe
 68   width="600"
 69   height="300"
 70   seamless
 71   frameBorder="0"
 72   scrolling="no"
 73   src="http://192.168.29.123:8080/superset/explore/?form_data=%7B%22datasource%22%3A%225__table%22%2C%22viz_type%22%3A%22big_number_total%22%2C%22slice_id%22%3A4%2C%22url_params%22%3A%7B%7D%2C%22granularity_sqla%22%3Anull%2C%22time_grain_sqla%22%3A%22P1D%22%2C%22time_range%22%3A%22Last+week%22%2C%22metric%22%3A%7B%22aggregate%22%3A%22SUM%22%2C%22column%22%3A%7B%22column_name%22%3A%22total_user_cnt%22%2C%22description%22%3Anull%2C%22expression%22%3Anull%2C%22filterable%22%3Atrue%2C%22groupby%22%3Atrue%2C%22id%22%3A19%2C%22is_dttm%22%3Afalse%2C%22optionName%22%3A%22_col_total_user_cnt%22%2C%22python_date_format%22%3Anull%2C%22type%22%3A%22INTEGER%2811%29%22%2C%22verbose_name%22%3Anull%7D%2C%22expressionType%22%3A%22SIMPLE%22%2C%22fromFormData%22%3Afalse%2C%22hasCustomLabel%22%3Afalse%2C%22label%22%3A%22SUM%28total_user_cnt%29%22%2C%22optionName%22%3A%22metric_b6nnimk8kvdvx_b6g4rmoq5tz3q%22%2C%22sqlExpression%22%3Anull%7D%2C%22adhoc_filters%22%3A%5B%5D%2C%22subheader%22%3A%22%E6%B6%88%E8%B4%B9%E8%AE%A2%E5%8D%95%E7%94%A8%E6%88%B7%E6%95%B0%22%2C%22y_axis_format%22%3A%22SMART_NUMBER%22%2C%22header_font_size%22%3A0.3%2C%22subheader_font_size%22%3A0.125%7D&standalone=true&height=300"
 74 >
 75 </iframe>
 76                 </div>
 77             </div>
 78         </div>
 79         <div class="row">
 80             <div class="col-md-4">
 81                 <div class="chart">
 82                     <!--TODO:导入Superset Chart iFame-->
 83                     <iframe
 84   width="600"
 85   height="300"
 86   seamless
 87   frameBorder="0"
 88   scrolling="no"
 89   src="http://192.168.29.123:8080/superset/explore/?form_data=%7B%22datasource%22%3A%223__table%22%2C%22viz_type%22%3A%22pie%22%2C%22slice_id%22%3A6%2C%22url_params%22%3A%7B%7D%2C%22granularity_sqla%22%3Anull%2C%22time_grain_sqla%22%3A%22P1D%22%2C%22time_range%22%3A%22Last+week%22%2C%22metric%22%3A%7B%22aggregate%22%3A%22SUM%22%2C%22column%22%3A%7B%22column_name%22%3A%22total_cnt%22%2C%22description%22%3Anull%2C%22expression%22%3Anull%2C%22filterable%22%3Atrue%2C%22groupby%22%3Atrue%2C%22id%22%3A12%2C%22is_dttm%22%3Afalse%2C%22optionName%22%3A%22_col_total_cnt%22%2C%22python_date_format%22%3Anull%2C%22type%22%3A%22INTEGER%2811%29%22%2C%22verbose_name%22%3Anull%7D%2C%22expressionType%22%3A%22SIMPLE%22%2C%22fromFormData%22%3Afalse%2C%22hasCustomLabel%22%3Afalse%2C%22label%22%3A%22SUM%28total_cnt%29%22%2C%22optionName%22%3A%22metric_g3xy8gfbdxz85_1dj7nwrwmavpl%22%2C%22sqlExpression%22%3Anull%7D%2C%22adhoc_filters%22%3A%5B%5D%2C%22groupby%22%3A%5B%22pay_type%22%5D%2C%22row_limit%22%3A25%2C%22pie_label_type%22%3A%22key_percent%22%2C%22number_format%22%3A%22SMART_NUMBER%22%2C%22donut%22%3Atrue%2C%22show_legend%22%3Atrue%2C%22show_labels%22%3Atrue%2C%22labels_outside%22%3Afalse%2C%22color_scheme%22%3A%22lyftColors%22%2C%22label_colors%22%3A%7B%7D%7D&standalone=true&height=300"
 90 >
 91 </iframe>
 92                 </div>
 93             </div>
 94             <div class="col-md-4">
 95                 <div class="chart">
 96                     <!--TODO:导入Superset Chart iFame-->
 97                     <iframe
 98   width="600"
 99   height="300"
100   seamless
101   frameBorder="0"
102   scrolling="no"
103   src="http://192.168.29.123:8080/superset/explore/?form_data=%7B%22datasource%22%3A%223__table%22%2C%22viz_type%22%3A%22pie%22%2C%22slice_id%22%3A5%2C%22url_params%22%3A%7B%7D%2C%22granularity_sqla%22%3Anull%2C%22time_grain_sqla%22%3A%22P1D%22%2C%22time_range%22%3A%22Last+week%22%2C%22metric%22%3A%7B%22aggregate%22%3A%22SUM%22%2C%22column%22%3A%7B%22column_name%22%3A%22total_money%22%2C%22description%22%3Anull%2C%22expression%22%3Anull%2C%22filterable%22%3Atrue%2C%22groupby%22%3Atrue%2C%22id%22%3A11%2C%22is_dttm%22%3Afalse%2C%22optionName%22%3A%22_col_total_money%22%2C%22python_date_format%22%3Anull%2C%22type%22%3A%22DOUBLE%22%2C%22verbose_name%22%3Anull%7D%2C%22expressionType%22%3A%22SIMPLE%22%2C%22fromFormData%22%3Afalse%2C%22hasCustomLabel%22%3Afalse%2C%22label%22%3A%22SUM%28total_money%29%22%2C%22optionName%22%3A%22metric_g7ci918csu37s_rnom4mmnkejc3%22%2C%22sqlExpression%22%3Anull%7D%2C%22adhoc_filters%22%3A%5B%5D%2C%22groupby%22%3A%5B%22pay_type%22%5D%2C%22row_limit%22%3A25%2C%22pie_label_type%22%3A%22key_percent%22%2C%22number_format%22%3A%22SMART_NUMBER%22%2C%22donut%22%3Atrue%2C%22show_legend%22%3Atrue%2C%22show_labels%22%3Atrue%2C%22labels_outside%22%3Afalse%2C%22color_scheme%22%3A%22googleCategory20c%22%2C%22label_colors%22%3A%7B%7D%7D&standalone=true&height=300"
104 >
105 </iframe>
106                 </div>
107             </div>
108             <div class="col-md-4">
109                 <div class="chart">
110                     <!--TODO:导入Superset Chart iFame-->
111                     <iframe
112   width="600"
113   height="300"
114   seamless
115   frameBorder="0"
116   scrolling="no"
117   src="http://192.168.29.123:8080/superset/explore/?form_data=%7B%22datasource%22%3A%226__table%22%2C%22viz_type%22%3A%22table%22%2C%22slice_id%22%3A7%2C%22url_params%22%3A%7B%7D%2C%22granularity_sqla%22%3Anull%2C%22time_grain_sqla%22%3A%22P1D%22%2C%22time_range%22%3A%22Last+week%22%2C%22groupby%22%3A%5B%22dt%22%2C%22username%22%5D%2C%22metrics%22%3A%5B%7B%22aggregate%22%3A%22SUM%22%2C%22column%22%3A%7B%22column_name%22%3A%22total_cnt%22%2C%22description%22%3Anull%2C%22expression%22%3Anull%2C%22filterable%22%3Atrue%2C%22groupby%22%3Atrue%2C%22id%22%3A24%2C%22is_dttm%22%3Afalse%2C%22optionName%22%3A%22_col_total_cnt%22%2C%22python_date_format%22%3Anull%2C%22type%22%3A%22INTEGER%2811%29%22%2C%22verbose_name%22%3Anull%7D%2C%22expressionType%22%3A%22SIMPLE%22%2C%22fromFormData%22%3Afalse%2C%22hasCustomLabel%22%3Afalse%2C%22label%22%3A%22SUM%28total_cnt%29%22%2C%22optionName%22%3A%22metric_39fftcwwbjyee_us0g1eyp716mv%22%2C%22sqlExpression%22%3Anull%7D%5D%2C%22percent_metrics%22%3A%5B%5D%2C%22timeseries_limit_metric%22%3Anull%2C%22row_limit%22%3A10000%2C%22include_time%22%3Afalse%2C%22order_desc%22%3Atrue%2C%22all_columns%22%3A%5B%5D%2C%22order_by_cols%22%3A%5B%5D%2C%22adhoc_filters%22%3A%5B%5D%2C%22table_timestamp_format%22%3A%22%25Y-%25m-%25d+%25H%3A%25M%3A%25S%22%2C%22page_length%22%3A0%2C%22include_search%22%3Atrue%2C%22table_filter%22%3Afalse%2C%22align_pn%22%3Afalse%2C%22color_pn%22%3Atrue%7D&standalone=true&height=300"
118 >
119 </iframe>
120                 </div>
121             </div>
122         </div>
123         <div class="row">
124             <div class="col-md-6">
125                 <div class="chart">
126                     <!--TODO:导入Superset Chart iFame-->
127 <iframe
128   width="900"
129   height="450"
130   seamless
131   frameBorder="0"
132   scrolling="no"
133   src="http://192.168.29.123:8080/superset/explore/?form_data=%7B%22datasource%22%3A%222__table%22%2C%22viz_type%22%3A%22dist_bar%22%2C%22slice_id%22%3A8%2C%22url_params%22%3A%7B%7D%2C%22granularity_sqla%22%3Anull%2C%22time_grain_sqla%22%3A%22P1D%22%2C%22time_range%22%3A%22Last+week%22%2C%22metrics%22%3A%5B%7B%22aggregate%22%3A%22SUM%22%2C%22column%22%3A%7B%22column_name%22%3A%22total_money%22%2C%22description%22%3Anull%2C%22expression%22%3Anull%2C%22filterable%22%3Atrue%2C%22groupby%22%3Atrue%2C%22id%22%3A6%2C%22is_dttm%22%3Afalse%2C%22optionName%22%3A%22_col_total_money%22%2C%22python_date_format%22%3Anull%2C%22type%22%3A%22DOUBLE%22%2C%22verbose_name%22%3Anull%7D%2C%22expressionType%22%3A%22SIMPLE%22%2C%22fromFormData%22%3Afalse%2C%22hasCustomLabel%22%3Afalse%2C%22label%22%3A%22SUM%28total_money%29%22%2C%22optionName%22%3A%22metric_rzvt2ak5a2k8d_ojwns1b9n3c5l%22%2C%22sqlExpression%22%3Anull%7D%5D%2C%22adhoc_filters%22%3A%5B%5D%2C%22groupby%22%3A%5B%22cat_name%22%5D%2C%22columns%22%3A%5B%5D%2C%22row_limit%22%3A10000%2C%22contribution%22%3Afalse%2C%22color_scheme%22%3A%22d3Category20%22%2C%22label_colors%22%3A%7B%7D%2C%22show_legend%22%3Atrue%2C%22show_bar_value%22%3Atrue%2C%22bar_stacked%22%3Afalse%2C%22order_bars%22%3Afalse%2C%22y_axis_format%22%3A%22SMART_NUMBER%22%2C%22y_axis_label%22%3A%22%22%2C%22show_controls%22%3Afalse%2C%22x_axis_label%22%3A%22%22%2C%22bottom_margin%22%3A%22auto%22%2C%22x_ticks_layout%22%3A%22auto%22%2C%22reduce_x_ticks%22%3Afalse%7D&standalone=true&height=450"
134 >
135 </iframe>
136                 </div>
137             </div>
138             <div class="col-md-6">
139                 <div class="chart">
140                     <!--TODO:导入Superset Chart iFame-->
141                     <iframe
142   width="900"
143   height="450"
144   seamless
145   frameBorder="0"
146   scrolling="no"
147   src="http://192.168.29.123:8080/superset/explore/?form_data=%7B%22datasource%22%3A%222__table%22%2C%22viz_type%22%3A%22dist_bar%22%2C%22slice_id%22%3A9%2C%22url_params%22%3A%7B%7D%2C%22granularity_sqla%22%3Anull%2C%22time_grain_sqla%22%3A%22P1D%22%2C%22time_range%22%3A%22Last+week%22%2C%22metrics%22%3A%5B%7B%22aggregate%22%3A%22SUM%22%2C%22column%22%3A%7B%22column_name%22%3A%22total_num%22%2C%22description%22%3Anull%2C%22expression%22%3Anull%2C%22filterable%22%3Atrue%2C%22groupby%22%3Atrue%2C%22id%22%3A7%2C%22is_dttm%22%3Afalse%2C%22optionName%22%3A%22_col_total_num%22%2C%22python_date_format%22%3Anull%2C%22type%22%3A%22INTEGER%2811%29%22%2C%22verbose_name%22%3Anull%7D%2C%22expressionType%22%3A%22SIMPLE%22%2C%22fromFormData%22%3Afalse%2C%22hasCustomLabel%22%3Afalse%2C%22label%22%3A%22SUM%28total_num%29%22%2C%22optionName%22%3A%22metric_r07p9o32b0fqo_rfpsd0830m6rm%22%2C%22sqlExpression%22%3Anull%7D%5D%2C%22adhoc_filters%22%3A%5B%5D%2C%22groupby%22%3A%5B%22cat_name%22%5D%2C%22columns%22%3A%5B%5D%2C%22row_limit%22%3A10000%2C%22contribution%22%3Afalse%2C%22color_scheme%22%3A%22bnbColors%22%2C%22label_colors%22%3A%7B%7D%2C%22show_legend%22%3Atrue%2C%22show_bar_value%22%3Atrue%2C%22bar_stacked%22%3Afalse%2C%22order_bars%22%3Afalse%2C%22y_axis_format%22%3A%22SMART_NUMBER%22%2C%22y_axis_label%22%3A%22%22%2C%22show_controls%22%3Afalse%2C%22x_axis_label%22%3A%22%22%2C%22bottom_margin%22%3A%22auto%22%2C%22x_ticks_layout%22%3A%22auto%22%2C%22reduce_x_ticks%22%3Afalse%7D&standalone=true&height=450"
148 >
149 </iframe>
150                 </div>
151             </div>
152         </div>
153         <div class="row">
154             <div class="col-md-12">
155                 <div class="chart">
156                     <!--TODO:导入Superset Chart iFame-->
157                     <iframe
158   width="1800"
159   height="300"
160   seamless
161   frameBorder="0"
162   scrolling="no"
163   src="http://192.168.29.123:8080/superset/explore/?form_data=%7B%22datasource%22%3A%222__table%22%2C%22viz_type%22%3A%22word_cloud%22%2C%22slice_id%22%3A10%2C%22url_params%22%3A%7B%7D%2C%22granularity_sqla%22%3Anull%2C%22time_grain_sqla%22%3A%22P1D%22%2C%22time_range%22%3A%22Last+week%22%2C%22series%22%3A%22cat_name%22%2C%22metric%22%3A%22count%22%2C%22adhoc_filters%22%3A%5B%5D%2C%22row_limit%22%3A100%2C%22size_from%22%3A30%2C%22size_to%22%3A100%2C%22rotation%22%3A%22random%22%2C%22color_scheme%22%3A%22SUPERSET_DEFAULT%22%2C%22label_colors%22%3A%7B%7D%7D&standalone=true&height=300"
164 >
165 </iframe>
166                 </div>
167             </div>
168         </div>
169     </div>
170 </body>
171 </html>

最终展示页面:

原文地址:https://www.cnblogs.com/sunyuhai/p/12408510.html

时间: 2024-11-09 01:46:04

可视化平台项目的相关文章

基于Hadoop离线大数据分析平台项目实战

基于Hadoop离线大数据分析平台项目实战  课程学习入口:http://www.xuetuwuyou.com/course/184 课程出自学途无忧网:http://www.xuetuwuyou.com 课程简介: 某购物电商网站数据分析平台,分为收集数据.数据分析和数据展示三大层面.其中数据分析主要依据大数据Hadoop生态系统常用组件进行处理,此项目真实的展现了大数据在企业中实际应用. 课程内容 (1)文件收集框架 Flume ①Flume 设计架构.原理(三大组件) ②Flume 初步使

手把手教你Web数据可视化平台搭建

原文链接:http://www.jianshu.com/p/ad1a49375da4 ,源代码请访问原文 PS.想获取全部源代码或者有不懂的问题的感兴趣的同学,请访问原文- 一.项目展示 这个Web数据可视化平台的效果如下(没加样式,主要侧重功能) 效果演示 这个数据可视化Demo能够实现如下功能: 1.csv文件上传(其他格式文件也可以) 2.自定义想要显示的数据 2.nodejs搭建服务器,解析csv文件数据 3.使用Highcharts进行数据可视化 4.关键参数计算并展示 二.实现思路和

关于3D可视化平台!

3D可视化,就是把复杂抽象的数据信息,以合适的视觉元素及视角去呈现,方便大家理解.记忆.传递! 3D可视化平台采用3D虚拟仿真技术,将机房进行虚拟仿真,并以此为依托来呈现IT设备的一切状况,使得监控信息的整合就变得直观.便捷,数据中心机房作为整个智慧检务工程系统的信息枢纽担负着重要作用,现已完成我省数据中心机房环境和资产的可视化浏览,可清晰完整展现整个机房环境和运行状况. 系统以3D可视化作为重要管理手段,对数据中心资产设备,资源设备运行状况等进行全面监控和管理,包括基础设备监控和基础设备管理两

AppCan中标首都机场移动平台项目

近日,正益无线AppCan依托东方航空.吉祥航空.国家电网.中化集团等大客 户项目的丰富成功经验,凭借企业移动信息化建设的良好口碑.强大的移动化实施部署经验和快速响应的技术团队,在与多家国内外移动厂商比拼中,脱颖而出,成 功中标首都机场移动平台项目,全力护航首都机场各项业务移动化进程. 北京首都国际机场是"中国第一国门",是中国最重要.规模最大.设备最先进.运输生产最繁忙的大型国际航空港,是中国的空中门户和对外交流的重要窗口.北京首都国际机场的年旅客吞吐量从1978年的103万人次增长

网络远程教育实施方案交流之(二)——网络教育平台项目的建设

网络教育平台项目的建设的方案能够自建也能够採购.但项目是否成功,并终于能够落地发展,还须要业主方认真的调研和分析,最有效的方法就是利用项目管理的方法,从前期的需求分析.调研.可行性分析,立项,建设期成本.质量.进度三大管理,后期測试bugfree,维护.客服服务等. 管理内容看起来复杂,事实上理顺了非常easy,大道至简.下面先从功能模块入手,然后再介绍实践和经验,其目的是让没有经验的读者少走弯路,具有相关经验的管理者分享交流,共同推动此项事业的发展. 曾有人问我项目是不是资金投入越多越好?事实

电商平台项目

某电商平台项目开发要点记录 本文是博主在开发某电商平台项目的一些杂项记录,方便自己和团队同事查阅,偏向于具体技术或应用的细节和个人理解,但也未必非常具体.文中未提的更多内容可能会另起篇章. 导航属性--EF实体关系fluent配置 AutoMapper Autofac Repository模式 Model & DTO 开源&商用.NET电商平台--NopCommerce(3.9版) & Himall(2.4版) 服务器搭建-VMware vSphere Hypervisor(esx

针对Elasticsearch的开源分析及可视化平台——Kibana

Kibana是一个针对Elasticsearch的开源分析及可视化平台,用来搜索.查看交互存储在Elasticsearch索引中的数据.使用Kibana,可以通过各种图表进行高级数据分析及展示. Kibana让海量数据更容易理解.它操作简单,基于浏览器的用户界面可以快速创建仪表板(dashboard)实时显示Elasticsearch查询动态. 在云市不需要复杂部署安装,一键使用Kibana.设置Kibana也非常简单,无需编码或者额外的基础架构,一分钟只能就能启动Elasticsearch索引

Linux平台项目中时间相关内容

由Linux内核提供的基本时间服务是计算自国际标准时间公元1970年1月1日00:00:00以来经过的秒数,以time_t类型表示,被称为"日历时间",time_t通常定义为一个int型或long型的量. 日历时间有几个典型的特性: 以国际标准时间而非本地时间计时. 可自动进行转换,例如变换到夏时制. 用一个time_t量保存时间和日期. 程序中获取日历时间使用time()函数,函数原型是: #include <time.h> time_t time(time_t *cal

迈瑞综合应用及流程管理平台项目

主题:迈瑞综合应用及流程管理平台项目技术框架交流 嘉宾:迈瑞集团 周舟 有些人一见钟情,有些人日久生情,迈瑞和K2就属于后者. 迈瑞的K2项目始于2010年,一开始和K2的情感磨合并不顺利,像所有父母之命媒妁之言的婚姻一样,一开始相敬如宾,直到一天天相处下来,摸透了彼此的脾气习性,才开始"天雷勾动地火",2012年掌握要领后,迈瑞开始出现爆发式的应用,仅当年就上线153个业务流程. 应用架构总览 技术架构-工作流引擎(WMP-2) 流程平台展示 技术架构-工作流引擎(WMP-1) (本