当前位置:网站首页>【数据可视化】Apache Superset 1.2.0教程 (二)——快速入门(可视化王者英雄数据)
【数据可视化】Apache Superset 1.2.0教程 (二)——快速入门(可视化王者英雄数据)
2022-06-11 20:33:00 【菜鸟蜀黍】
文章目录

上一篇我们已经成功的安装了superset,那么该如何可视化我们的数据呢?本文将可视化王者英雄的数据,快速的入门Superset。
一、连接数据源
首先确保mysql可以正常连接使用,并且准备好数据。

登录进入superset,选择Databases

点击右上方+号,新建数据库

superset是通过SQLAlchemy连接数据库的。通过官方文档找到mysql的连接方式。
https://docs.sqlalchemy.org/
MySQL
The MySQL dialect uses mysql-python as the default DBAPI. There are many MySQL DBAPIs available, including MySQL-connector-python and OurSQL:
# default
engine = create_engine('mysql://scott:[email protected]/foo')
# mysqlclient (a maintained fork of MySQL-Python)
engine = create_engine('mysql+mysqldb://scott:[email protected]/foo')
# PyMySQL
engine = create_engine('mysql+pymysql://scott:[email protected]/foo')
这里我们先安装pymysql
随后按这个格式设置好连接即可
mysql+pymysql://root:[email protected]/honor
连接成功!

二、配置SQL Lab功能
配置好数据库以后,我们还希望对其进行灵活的查询,这时候就得用到SQL Lab功能了。
首先,开启sql lab权限
选择ADVANCED页,将SQL Lab相关权限勾选。

保存可以看到相关权限已开启。

选择Sql Lab菜单下Sql Editor

选择Database,Schema,Table。输入sql语句,RUN进行执行,可以看到查询结果。

三、简单可视化
数据源配置完成,并可以正常查询了,下面我们来对数据进行简单的可视化。
首先选择EXPLORE,保存该查询为dataset。

进入到dataset设置页面,这里可以看到默认的类型为Table,我们知道superset支持非常多的可视化图表,本章只做Table类型的,未来会继续讲解每个图表的具体操作。

选择SAVE,保存为Charts。这样我们刚刚的查询就以图表的形式保存了下来。

新建一个Dashboard,选择右侧的CHARTS,选择我们建好的图表直接拖拽过来。可以调整下大小与布局。保存。

保存成功,新建的Dashboard就显示在列表中了。未来我们选择将其嵌入到我们网页中,或者以邮件的形式发送出去。

这样,我们使用Superset的第一张图表就做好了。

本文详细讲解了Apache Superset 1.2.0可视化数据的全过程,下一篇我们来进行superset的各种图表的操作与实践。
踩坑记录
一、连接mysql失败
ERROR: Could not load database driver: MySQLEngineSpec
MySQLdb 不支持 Python 3, 需要使用 pymysql.
安装pymysql:
使用下面的写法
mysql+pymysql://user:[email protected]/databasename
二、安装pymysql失败
请检查网络情况,网速正常情况下没有问题
边栏推荐
- 2022-2028 global and Chinese thermal conductivity hydrogen analyzer Market Status and future development trend
- Text to speech small software
- [Err] 1045 - Access denied for user ‘root‘@‘%‘ (using password: YES)
- Two end carry output character
- Deploy website traffic statistics background based on Tencent cloud lightweight application server and umami
- Unity package manager starting server stuck
- Recompile kubeadm to solve the problem of certificate expiration in one year
- unity里面使用opencv,qt建立plugin(一)
- 2022-2028 global and Chinese thermopile and microbolometer infrared detector Market Status and future development trend
- Black circle display implementation
猜你喜欢

The tutor transferred me 800 yuan and asked me to simulate a circuit (power supply design)

moderlarts第一次培訓

The latest test questions and answers for the eight major members (standard members) of Ningxia architecture in 2022

MySQL installation free configuration tutorial under Windows mysql-5.6.51-winx64 Zip version

In unity, opencv and QT are used to create a plugin (I)

unity里面使用opencv,qt建立plugin(一)

These postgraduate entrance examination majors are easy to be confused. If you make a mistake, you will take the exam in vain!

Redis第四话 -- redis高性能原理(多路复用)和高可用分析(备份、主从)

Text to speech small software

Teach you how to grab ZigBee packets through cc2531 and parse encrypted ZigBee packets
随机推荐
Introduction to jobrunr, a distributed background job scheduler - jaxenter
2022-2028 global and Chinese thermopile and microbolometer infrared detector Market Status and future development trend
2022-2028 global and Chinese thermal ionization isotope mass spectrometer (TIMS) market status and future development trend
VS2010 cannot open when linking sql2008 database
Shanghai internal promotion 𞓜 Yuyang teacher's research group of Shanghai Chizhi research institute recruits full-time researchers
"Video version Mae" of hekaiming team, efficient video pre training! The effect is also very good when mask ratio is up to 90
8 r subset
[Err] 1045 - Access denied for user ‘root‘@‘%‘ (using password: YES)
Detailed tutorial on installing MySQL database in Linux environment (including uninstallation and password reset process)
Leetcode2027. Minimum number of operations to convert a string (yes, once)
The first bullet of comparative learning
Figure guessing game
Unity截屏
26. 定时器
Current situation and future development trend of thermoelectric generator Market in the world and China from 2022 to 2028
First modelarts training
Two minutes to show you the charging standard of the Sub Ledger System
Teach you how to grab ZigBee packets through cc2531 and parse encrypted ZigBee packets
7905 and TL431 negative voltage regulator circuit - regulator and floating circuit relative to the positive pole of the power supply
Gestionnaire de paquets d'Unit é Starting Server Stuck