← 返回
未分类 中文

Chart Animation

Generate dark-themed animated trend charts and static overview images from time-series JSON data with customizable titles and frame rates.
从时间序列JSON数据生成深色主题的动态趋势图和静态概览图,支持自定义标题和帧率。
ravenquasar ravenquasar 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 82
下载
💾 1
安装
1
版本
#latest

概述

chart-animation

Version: 1.0.0

Generate animated trend charts from time-series data. Creates GIF/MP4 animations with dark theme styling and static overview images.

Usage

# Generate animation from data
chart-animation --data <path/to/data.json> --output <output-dir>

# With custom options
chart-animation --data data.json --output ./output --title "Temperature Trends" --fps 15

Data Format

Input JSON should have this structure:

{
  "metadata": {
    "generated_at": "2026-06-06",
    "source": "your data source"
  },
  "dates": ["2025-06-01", "2025-06-08", ...],
  "series": {
    "Series A": {
      "values": [12.5, 14.2, ...],
      "color": "#E74C3C"
    },
    "Series B": {
      "values": [15.0, 16.8, ...],
      "color": "#3498DB"
    }
  }
}

Output

  • /animation.gif - Animated chart (GIF format)
  • /animation.mp4 - High-quality video (if ffmpeg available)
  • /overview.png - Static multi-panel overview

Features

  • Dark theme: Professional dark background for presentations
  • Multi-series support: Up to 4 data series with distinct colors
  • Responsive X-axis: Automatically formats date labels
  • Overview chart: Grid layout showing each series separately
  • Min/Max markers: Highlights extreme values in overview

Dependencies

  • Python 3.8+
  • matplotlib
  • numpy
  • pillow (for GIF)
  • ffmpeg (optional, for MP4)

Install:

pip install matplotlib numpy pillow
# For MP4 support:
# macOS: brew install ffmpeg
# Ubuntu: sudo apt install ffmpeg

Example

# Create sample data
python3 -c "
import json
data = {
  'metadata': {'source': 'example'},
  'dates': ['2025-01', '2025-02', '2025-03', '2025-04'],
  'series': {
    'Revenue': {'values': [100, 120, 115, 140], 'color': '#27AE60'},
    'Cost': {'values': [80, 85, 90, 88], 'color': '#E74C3C'}
  }
}
print(json.dumps(data, indent=2))
" > data.json

# Generate animation
chart-animation --data data.json --output ./charts

Options

OptionDefaultDescription
------------------------------
--datarequiredPath to input JSON
--output./outputOutput directory
--titleautoChart title (auto from metadata)
--fps12Animation frames per second
--width14Figure width in inches
--height8Figure height in inches

Notes

  • For Chinese characters, ensure fonts like "PingFang SC" or "SimHei" are installed
  • The skill auto-detects Y-axis range from data
  • Overview charts use 2x2 grid for up to 4 series

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-06-07 13:09

安全检测

腾讯云安全 (Keen)

队列中

腾讯云安全 (Sanbu)

队列中

🔗 相关推荐

data-analysis

AdMapix

fly0pants
AdMapix 原始数据层,提供广告创意、应用、排名、下载/收入及市场元数据。返回 AdMapix API 的结构化 JSON;调用方...
★ 296 📥 138,055
design-media

Vision Helper — AI Image Analysis

ravenquasar
使用 Ollama 本地或云端视觉模型分析图像,识别内容、UI 元素和截图,支持 OCR 提取文本。
★ 0 📥 949
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 206 📥 67,136