📈 文本情节
https://duckdb.org/community_extensions/extensions/textplot.html
https://query.farm/duckdb_extension_textplot.html
Textplot 扩展将基于文本的数据可视化直接引入 DuckDB 中的 SQL 查询。无需离开数据库环境即可创建令人惊叹的 ASCII/Unicode 图表、条形图和密度图。
使用案例
Textplot 扩展非常适合:
快速数据探索:直接在终端中可视化分布和趋势
仪表板创建:将视觉元素添加到基于文本的报表和仪表板
监控和警报:为系统指标和 KPI 创建可视化指标
数据质量检查:立即发现数据中的异常值和模式
命令行分析:为 CLI 工具和脚本构建漂亮的图表
文档:在自述文件和文档中包含可视化数据摘要
嵌入式分析:向应用程序添加轻量级可视化效果,而无需繁重的图表库
安装
textplot 是一个 DuckDB 社区扩展。
您现在可以使用以下 SQL 来使用它:
install textplot from community;
load textplot
功能
tp_bar(value, ...options)
创建具有可自定义样式和颜色的水平条形图。
基本用法:
-- Simple progress bar (50% filled)
SELECT tp_bar(0.5);
┌──────────────────────┐
│ tp_bar(0.5) │
│ varchar │
├──────────────────────┤
│ 🟥🟥🟥🟥🟥⬜⬜⬜⬜⬜ │
└──────────────────────┘
-- Custom width and range
SELECT tp_bar(75, min := 0, max := 100, width := 20);
┌───────────────────────────────────────────────┐
│ tp_bar(75, min := 0, max := 100, width := 20) │
│ varchar │
├───────────────────────────────────────────────┤
│ 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥⬜⬜⬜⬜⬜ │
└───────────────────────────────────────────────┘
高级选项:
-- Custom colors and shapes
SELECT tp_bar(0.8, shape := 'circle', on_color := 'green', off_color := 'white') as bar;
┌──────────────────────┐
│ bar │
│ varchar │
├──────────────────────┤
│ 🟢🟢🟢🟢🟢🟢🟢🟢⚪⚪ │
└──────────────────────┘
-- Threshold-based coloring
SELECT tp_bar(85,
min := 0, max := 100,
thresholds := [
{'threshold': 90, 'color': 'red'},
{'threshold': 70, 'color': 'yellow'},
{'threshold': 0, 'color': 'green'}
]
) as bar;
┌──────────────────────┐
│ bar │
│ varchar │
├──────────────────────┤
│ 🟨🟨🟨🟨🟨🟨🟨🟨🟨⬜ │
└──────────────────────┘
-- Custom characters
SELECT tp_bar(0.7, on := '█', off := '░', width := 15) as bar;
┌─────────────────┐
│ bar │
│ varchar │
├─────────────────┤
│ ███████████░░░░ │
└─────────────────┘
SELECT round(n,4),
tp_bar(n,
width := 14,
shape := 'circle',
off_color :='black',
filled := false,
thresholds := [
(0.8, 'red'),
(0.7, 'orange'),
(0.6, 'yellow'),
(0.0, 'green')
]) as bar
FROM (select random() as n from generate_series(10));
┌─────────────┬──────────────────────────────┐
│ round(n, 4) │ bar │
│ double │ varchar │
├─────────────┼──────────────────────────────┤
│ 0.9889 │ ⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫🔴 │
│ 0.6242 │ ⚫⚫⚫⚫⚫⚫⚫⚫🟡⚫⚫⚫⚫⚫ │
│ 0.6013 │ ⚫⚫⚫⚫⚫⚫⚫🟡⚫⚫⚫⚫⚫⚫ │
│ 0.669 │ ⚫⚫⚫⚫⚫⚫⚫⚫🟡⚫⚫⚫⚫⚫ │
│ 0.8363 │ ⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫🔴⚫⚫ │
│ 0.9193 │ ⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫🔴⚫ │
│ 0.8629 │ ⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫🔴⚫⚫ │
│ 0.8296 │ ⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫🔴⚫⚫ │
│ 0.0824 │ 🟢⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫ │
│ 0.0281 │ ⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫ │
│ 0.2682 │ ⚫⚫⚫🟢⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫ │
├─────────────┴──────────────────────────────┤
│ 11 rows 2 columns │
└────────────────────────────────────────────┘
SELECT round(n,4),
tp_bar(n,
width := 14,
shape := 'circle',
off_color :='black',
filled := true,
thresholds := [
(0.8, 'red'),
(0.7, 'orange'),
(0.6, 'yellow'),
(0.0, 'green')
]) as bar
FROM (select random() as n from generate_series(10));
┌─────────────┬──────────────────────────────┐
│ round(n, 4) │ bar │
│ double │ varchar │
├─────────────┼──────────────────────────────┤
│ 0.3818 │ 🟢🟢🟢🟢🟢⚫⚫⚫⚫⚫⚫⚫⚫⚫ │
│ 0.1919 │ 🟢🟢🟢⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫ │
│ 0.5885 │ 🟢🟢🟢🟢🟢🟢🟢🟢⚫⚫⚫⚫⚫⚫ │
│ 0.9558 │ 🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴⚫ │
│ 0.4463 │ 🟢🟢🟢🟢🟢🟢⚫⚫⚫⚫⚫⚫⚫⚫ │
│ 0.6024 │ 🟡🟡🟡🟡🟡🟡🟡🟡⚫⚫⚫⚫⚫⚫ │
│ 0.0114 │ ⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫⚫ │
│ 0.4993 │ 🟢🟢🟢🟢🟢🟢🟢⚫⚫⚫⚫⚫⚫⚫ │
│ 0.6884 │ 🟡🟡🟡🟡🟡🟡🟡🟡🟡🟡⚫⚫⚫⚫ │
│ 0.7929 │ 🟠🟠🟠🟠🟠🟠🟠🟠🟠🟠🟠⚫⚫⚫ │
│ 0.3507 │ 🟢🟢🟢🟢🟢⚫⚫⚫⚫⚫⚫⚫⚫⚫ │
├─────────────┴──────────────────────────────┤
│ 11 rows 2 columns │
└────────────────────────────────────────────┘
参数:
value:要可视化的数值
min:最小值(默认值:0)
max:最大值(默认值:1.0)
width:条形宽度(以字符为单位)(默认值:10)
shape: 'square', 'circle' 或 'heart' (默认值: 'square')
on_color/off_color:颜色名称(红、绿、蓝、黄等)
on/off:填充/空白部分的自定义字符
filled:布尔值,填充所有块或仅填充端点(默认值:true)
thresholds:条件着色的阈值对象列表
tp_density(values, ...options)
从数值数据数组创建密度图和直方图。
基本用法:
-- Simple density plot
SELECT tp_density([1, 2, 3, 4, 5, 4, 3, 2, 1]) as density;
┌──────────────────────┐
│ density │
│ varchar │
├──────────────────────┤
│ █ █ █ █ ▒ │
└──────────────────────┘
-- Custom width and style
SELECT tp_density([1, 2, 3, 2, 1], width := 30, style := 'height') as density;
┌────────────────────────────────┐
│ density │
│ varchar │
├────────────────────────────────┤
│ █ █ ▄ │
└────────────────────────────────┘
样式选项:
-- ASCII style for compatibility
SELECT tp_density([1, 5, 3, 8, 2], style := 'ascii') as density;
┌──────────────────────┐
│ density │
│ varchar │
├──────────────────────┤
│ @ @ @ @ @ │
└──────────────────────┘
-- Dot style for subtle visualization
SELECT tp_density([1, 5, 3, 8, 2], style := 'dots') as density;
┌──────────────────────┐
│ density │
│ varchar │
├──────────────────────┤
│ ● ● ● ● ● │
└──────────────────────┘
-- Colorful emoji styles
SELECT tp_density([1, 5, 3, 8, 2], style := 'rainbow_circle') as density;
┌──────────────────────────────────────────┐
│ density │
│ varchar │
├──────────────────────────────────────────┤
│ ⚪⚫⚪⚫⚫⚪⚫⚫⚫⚫⚫⚪⚫⚫⚫⚫⚫⚫⚫⚪ │
└──────────────────────────────────────────┘
参数:
values:数值数组
width:绘图宽度(以字符为单位)(默认值:20)
style:字符集样式(“shaded”、“ascii”、“dots”、“height”、“circles”、“safety”、“rainbow_circle”、“rainbow_square”、“moon”、“sparse”、“white”)
graph_chars:密度级别的自定义字符数组
marker:突出特定值的字符
可用样式:
shaded:(默认)░▒▓█
ascii:.:+#@
dots:.•●
height:▁▂▃▄▅▆▇█
circles:⚫⚪🟡🟠🔴
rainbow_circle:⚫🟤🟣🔵🟢🟡🟠🔴⚪
tp_sparkline(values, ...options)
创建紧凑的迷你图,非常适合显示时间序列数据和小倍数的趋势。
基本用法:
-- Simple absolute value sparkline
SELECT tp_sparkline([1, 3, 2, 5, 4, 6, 2, 1]) as sparkline;
┌──────────────────────┐
│ sparkline │
│ varchar │
├──────────────────────┤
│ ==---##***@@--- │
└──────────────────────┘
-- Delta mode showing change direction
SELECT tp_sparkline([100, 105, 102, 108, 95], mode := 'delta') as sparkline;
┌──────────────────────┐
│ sparkline │
│ varchar │
├──────────────────────┤
│ ↑↑↑↑↑↓↓↓↓↓↑↑↑↑↑↓↓↓↓↓ │
└──────────────────────┘
-- Trend mode with magnitude
SELECT tp_sparkline([10, 12, 11, 15, 8], mode := 'trend', theme := 'slopes') as sparkline;
┌───────────────────────────┐
│ sparkline │
│ varchar │
├───────────────────────────┤
│ /////\\\\\/////\\\\\\\\\\ │
└───────────────────────────┘
可视化模式:
1. 绝对模式(默认) - 将实际值显示为高度:
-- Stock prices over time
SELECT tp_sparkline([45.2, 47.1, 46.8, 49.3, 52.1, 48.7], width := 20, theme := 'utf8_blocks') as sparkline;
┌──────────────────────┐
│ sparkline │
│ varchar │
├──────────────────────┤
│ ▂▂▂▂▂▂▅▅▅▅███▄▄▄ │
└──────────────────────┘
-- System CPU usage
SELECT tp_sparkline([25, 45, 78, 92, 67, 34], theme := 'ascii_basic', width := 15) as sparkline;
┌─────────────────┐
│ sparkline │
│ varchar │
├─────────────────┤
│ --###@@***.. │
└─────────────────┘
2. 增量模式 - 显示变化方向(向上/相同/向下):
-- Sales trend directions
SELECT tp_sparkline([1000, 1200, 1150, 1300, 980], mode := 'delta', theme := 'arrows') as sparkline;
┌──────────────────────┐
│ sparkline │
│ varchar │
├──────────────────────┤
│ ↑↑↑↑↑↓↓↓↓↓↑↑↑↑↑↓↓↓↓↓ │
└──────────────────────┘
-- Temperature changes
SELECT tp_sparkline([72, 75, 75, 78, 71], mode := 'delta', theme := 'faces') as sparkline;
┌──────────────────────────────────────────┐
│ sparkline │
│ varchar │
├──────────────────────────────────────────┤
│ 😊😊😊😊😊😐😐😐😐😐😊😊😊😊😊😞😞😞😞😞 │
└──────────────────────────────────────────┘
3. 趋势模式 - 显示大小的变化方向:
-- Market volatility
SELECT tp_sparkline([100, 110, 105, 125, 90], mode := 'trend', theme := 'intensity') as sparkline;
┌───────────────────────────┐
│ sparkline │
│ varchar │
├───────────────────────────┤
│ +++++-----+++++---------- │
└───────────────────────────┘
-- Server response times
SELECT tp_sparkline([150, 145, 147, 180, 120], mode := 'trend', theme := 'arrows') as sparkline;
┌──────────────────────┐
│ sparkline │
│ varchar │
├──────────────────────┤
│ ↓↓↓↓↓↑↑↑↑↑↑↑↑↑↑⇩⇩⇩⇩⇩ │
└──────────────────────┘
按模式划分的可用主题:
绝对模式主题:
utf8_blocks:(默认)▁▂▃▄▅▆▇█
ascii_basic:.-=+*#%@
hearts:🤍🤎❤️💛💚💙💜🖤
faces:😐🙂😊😃😄😁🤩🤯
三角洲模式主题:
arrows:(默认)↓→↑
triangles:▼◆▲
ascii_arrows:v-^
math:-=+
faces:😞😐😊
thumbs:👎👍👍
trends:📉➡️📈
simple:\\_/
趋势模式主题:
arrows:(默认)⇩↓→↑⇧
ascii:Vv-^A
slopes:\\\\ \\ _ / //
intensity:-- - = + ++
faces:😭😞😐😊🤩
chart:📉📊➡️📊📈
参数:
values:数值数组
mode:“绝对”、“delta”或“趋势”(默认值:“absolute”)
theme:主题名称(因模式而异,请参阅上面的列表)
width:迷你图宽度(以字符为单位)(默认值:20)
tp_qr(value, ...options)
创建具有可自定义纠错级别和显示样式的 QR 码。
基本用法:
.mode ascii
-- Simple QR code
SELECT tp_qr('Hello, World!');
⬛⬛⬛⬛⬛⬛⬛⬜⬛⬜⬛⬜⬛⬜⬜⬜⬛⬜⬛⬛⬛⬛⬛⬛⬛
⬛⬜⬜⬜⬜⬜⬛⬜⬛⬛⬜⬜⬜⬛⬛⬛⬜⬜⬛⬜⬜⬜⬜⬜⬛
⬛⬜⬛⬛⬛⬜⬛⬜⬛⬜⬛⬜⬛⬛⬜⬛⬛⬜⬛⬜⬛⬛⬛⬜⬛
⬛⬜⬛⬛⬛⬜⬛⬜⬜⬜⬜⬛⬛⬜⬛⬛⬜⬜⬛⬜⬛⬛⬛⬜⬛
⬛⬜⬛⬛⬛⬜⬛⬜⬜⬛⬜⬜⬜⬛⬛⬜⬛⬜⬛⬜⬛⬛⬛⬜⬛
⬛⬜⬜⬜⬜⬜⬛⬜⬛⬜⬜⬛⬜⬜⬛⬛⬛⬜⬛⬜⬜⬜⬜⬜⬛
⬛⬛⬛⬛⬛⬛⬛⬜⬛⬜⬛⬜⬛⬜⬛⬜⬛⬜⬛⬛⬛⬛⬛⬛⬛
⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬛⬜⬜⬛⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬛⬛⬛⬜⬛⬜⬛⬛⬛⬜⬛⬜⬛⬛⬛⬛⬛⬛⬜⬜⬛⬛⬛
⬛⬛⬛⬜⬜⬛⬜⬜⬛⬜⬜⬜⬛⬛⬜⬛⬜⬜⬜⬛⬜⬜⬛⬜⬜
⬛⬜⬜⬜⬛⬜⬛⬛⬛⬛⬜⬜⬜⬜⬛⬛⬜⬛⬜⬜⬛⬛⬜⬛⬛
⬛⬛⬜⬛⬜⬛⬜⬛⬛⬜⬜⬜⬛⬜⬜⬜⬛⬜⬛⬜⬜⬜⬜⬛⬛
⬜⬜⬛⬜⬜⬛⬛⬛⬜⬛⬜⬛⬛⬛⬛⬛⬜⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬜⬛⬛⬛⬜⬜⬜⬛⬜⬜⬛⬛⬜⬜⬛⬛⬜⬜⬛⬜⬜⬛⬜⬜
⬛⬜⬜⬜⬜⬜⬛⬜⬜⬛⬜⬛⬜⬜⬜⬜⬜⬛⬛⬛⬛⬛⬜⬛⬛
⬛⬜⬛⬛⬛⬜⬜⬜⬜⬜⬛⬜⬜⬜⬛⬜⬛⬜⬛⬛⬛⬜⬜⬜⬛
⬛⬜⬛⬜⬜⬛⬛⬛⬜⬜⬜⬛⬛⬜⬛⬜⬛⬛⬛⬛⬛⬛⬛⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬛⬜⬜⬜⬜⬛⬛⬜⬛⬜⬜⬜⬛⬜⬛⬜⬜
⬛⬛⬛⬛⬛⬛⬛⬜⬜⬜⬜⬜⬜⬛⬛⬛⬛⬜⬛⬜⬛⬜⬛⬛⬛
⬛⬜⬜⬜⬜⬜⬛⬜⬜⬜⬜⬛⬜⬜⬜⬛⬛⬜⬜⬜⬛⬛⬜⬛⬜
⬛⬜⬛⬛⬛⬜⬛⬜⬛⬜⬛⬜⬜⬜⬛⬛⬛⬛⬛⬛⬛⬛⬛⬜⬜
⬛⬜⬛⬛⬛⬜⬛⬜⬛⬛⬜⬜⬜⬛⬛⬜⬜⬜⬛⬜⬛⬛⬜⬜⬛
⬛⬜⬛⬛⬛⬜⬛⬜⬛⬛⬜⬛⬛⬛⬛⬛⬜⬜⬛⬛⬜⬛⬜⬜⬛
⬛⬜⬜⬜⬜⬜⬛⬜⬜⬛⬛⬛⬜⬜⬛⬛⬜⬛⬜⬛⬛⬜⬜⬜⬛
高级选项:
-- Custom colors and shapes
SELECT tp_qr('https://query.farm', ecc := 'high', "on" := '🟡', off := '⚫');
🟡🟡🟡🟡🟡🟡🟡⚫🟡⚫🟡⚫🟡⚫🟡⚫⚫⚫🟡⚫🟡⚫🟡🟡🟡🟡🟡🟡🟡
🟡⚫⚫⚫⚫⚫🟡⚫🟡⚫⚫⚫🟡⚫🟡⚫🟡⚫⚫🟡⚫⚫🟡⚫⚫⚫⚫⚫🟡
🟡⚫🟡🟡🟡⚫🟡⚫🟡🟡🟡🟡🟡🟡⚫🟡🟡⚫⚫🟡🟡⚫🟡⚫🟡🟡🟡⚫🟡
🟡⚫🟡🟡🟡⚫🟡⚫⚫⚫⚫🟡🟡🟡⚫⚫🟡🟡⚫🟡⚫⚫🟡⚫🟡🟡🟡⚫🟡
🟡⚫🟡🟡🟡⚫🟡⚫⚫⚫🟡🟡🟡🟡🟡🟡⚫⚫⚫🟡🟡⚫🟡⚫🟡🟡🟡⚫🟡
🟡⚫⚫⚫⚫⚫🟡⚫🟡⚫⚫🟡⚫⚫🟡⚫🟡⚫🟡⚫🟡⚫🟡⚫⚫⚫⚫⚫🟡
🟡🟡🟡🟡🟡🟡🟡⚫🟡⚫🟡⚫🟡⚫🟡⚫🟡⚫🟡⚫🟡⚫🟡🟡🟡🟡🟡🟡🟡
⚫⚫⚫⚫⚫⚫⚫⚫🟡🟡⚫🟡⚫🟡🟡🟡🟡⚫⚫⚫🟡⚫⚫⚫⚫⚫⚫⚫⚫
⚫⚫🟡🟡🟡⚫🟡⚫🟡🟡🟡🟡⚫⚫🟡🟡🟡⚫🟡⚫🟡🟡🟡🟡⚫⚫🟡🟡🟡
🟡🟡🟡🟡⚫🟡⚫🟡⚫🟡🟡🟡⚫🟡⚫🟡⚫⚫⚫⚫⚫🟡⚫⚫🟡🟡🟡⚫🟡
🟡🟡🟡⚫⚫🟡🟡🟡🟡⚫⚫🟡⚫⚫🟡⚫🟡🟡🟡⚫🟡🟡🟡🟡🟡⚫🟡⚫⚫
🟡⚫⚫⚫⚫⚫⚫⚫🟡🟡⚫🟡⚫🟡⚫⚫⚫⚫⚫⚫⚫🟡🟡🟡⚫🟡⚫🟡⚫
⚫🟡🟡🟡🟡🟡🟡⚫⚫⚫⚫🟡🟡🟡🟡🟡⚫⚫🟡⚫🟡🟡⚫🟡⚫⚫🟡🟡🟡
🟡⚫🟡⚫🟡🟡⚫⚫⚫⚫⚫⚫🟡🟡🟡⚫🟡🟡⚫🟡🟡🟡🟡⚫🟡🟡⚫🟡🟡
⚫⚫⚫🟡⚫⚫🟡⚫🟡🟡⚫🟡🟡⚫⚫⚫🟡⚫⚫⚫🟡⚫🟡🟡⚫⚫⚫🟡⚫
⚫⚫🟡⚫⚫🟡⚫⚫🟡⚫🟡🟡⚫⚫🟡🟡🟡⚫🟡⚫⚫🟡🟡⚫🟡🟡⚫⚫⚫
⚫🟡⚫⚫🟡🟡🟡🟡⚫⚫⚫⚫🟡⚫⚫⚫⚫🟡🟡⚫⚫⚫🟡⚫⚫🟡🟡🟡🟡
🟡🟡🟡⚫⚫🟡⚫🟡🟡⚫🟡⚫⚫⚫🟡🟡⚫🟡⚫⚫🟡🟡⚫🟡🟡🟡⚫🟡🟡
🟡⚫⚫🟡⚫🟡🟡🟡⚫⚫🟡🟡⚫⚫⚫🟡🟡⚫🟡🟡⚫⚫🟡⚫⚫⚫🟡⚫⚫
🟡⚫🟡⚫⚫⚫⚫⚫🟡🟡🟡🟡🟡🟡🟡⚫⚫⚫⚫🟡🟡⚫🟡⚫🟡🟡⚫🟡🟡
🟡⚫🟡🟡⚫🟡🟡⚫⚫⚫🟡⚫🟡🟡⚫⚫⚫⚫⚫🟡🟡🟡🟡🟡🟡⚫🟡🟡⚫
⚫⚫⚫⚫⚫⚫⚫⚫🟡🟡⚫⚫🟡⚫⚫⚫🟡🟡🟡🟡🟡⚫⚫⚫🟡🟡⚫⚫🟡
🟡🟡🟡🟡🟡🟡🟡⚫⚫⚫⚫⚫⚫⚫🟡⚫⚫⚫🟡🟡🟡⚫🟡⚫🟡⚫⚫⚫⚫
🟡⚫⚫⚫⚫⚫🟡⚫⚫🟡⚫⚫🟡⚫🟡🟡🟡🟡⚫🟡🟡⚫⚫⚫🟡🟡⚫🟡🟡
🟡⚫🟡🟡🟡⚫🟡⚫🟡🟡🟡🟡⚫🟡⚫🟡⚫🟡⚫⚫🟡🟡🟡🟡🟡🟡🟡🟡⚫
🟡⚫🟡🟡🟡⚫🟡⚫🟡🟡⚫🟡⚫🟡🟡⚫🟡🟡🟡🟡🟡🟡⚫🟡⚫⚫⚫⚫⚫
🟡⚫🟡🟡🟡⚫🟡⚫🟡🟡⚫⚫⚫⚫🟡🟡⚫⚫⚫🟡🟡🟡🟡🟡🟡🟡⚫🟡⚫
🟡⚫⚫⚫⚫⚫🟡⚫⚫⚫⚫⚫🟡🟡⚫🟡🟡⚫🟡🟡⚫🟡⚫⚫🟡🟡⚫🟡⚫
🟡🟡🟡🟡🟡🟡🟡⚫⚫🟡🟡⚫🟡🟡⚫⚫🟡🟡⚫⚫⚫⚫⚫⚫🟡🟡🟡⚫⚫
参数:
value:要在 QR 码中编码的字符串值。
ecc:纠错级别(“低”、“中”、“四分位数”、“高”,默认值:“低”)
on:填充模块的字符(默认值:'⬛')
off:空模块的字符(默认值:'⬜')
提示和最佳实践
选择合适的宽度:较长的条形图(宽度 20-30)适用于仪表板,较短的条形图(宽度 10-15)适用于紧凑的报表
使用状态指示器阈值:非常适合显示运行状况、性能或风险级别
与常规指标结合使用:文本图补充而不是替换数值
考虑您的受众:ASCII 样式无处不在,表情符号样式更具视觉吸引力,但需要 Unicode 支持
利用分布密度图:非常适合显示数据模式、异常值和分布
贡献
Textplot 扩展是开源的,由 Query.Farm 开发。欢迎投稿!
许可证
麻省理工学院许可证
323

被折叠的 条评论
为什么被折叠?



