AI Agent Hub
Back to skills
Smart Charts Data Visualization icon

Smart Charts Data Visualization

Data Analysis Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @user_5b28ea14/smart-charts.

About this skill

The Challenge of Converting Raw Data to Interactive Charts

In data analysis workflows, transforming raw data in CSV, Excel, or JSON formats into visual charts often involves pain points: manual coding for data cleaning, selecting appropriate chart types, and generating browser-compatible files. This process is time-consuming and error-prone, especially for non-technical analysts. smart-charts addresses this by automating the pipeline through a CLI tool that generates interactive HTML charts based on ECharts, allowing analysts to focus on insights rather than coding details.

Core Capabilities and Workflow

The skill provides a complete CLI workflow with key steps:

  • Data Parsing and Normalization: data_parser.py handles input files (supporting .csv, .xlsx, .json), auto-detecting encodings (e.g., UTF-8, GBK) and delimiters. Column names are normalized post-parsing (e.g., lowercase, special characters to _) for consistency.
  • Chart Generation and Transform Code: Called via cli.py, it supports 21 chart types (e.g., line, bar, pie, scatter). When data doesn’t match the target chart format, --transform-code injects LLM-generated Python code (executed in a sandbox with only df, pd, np variables) for aggregation, reshaping, or filtering. For example, transforming long data for a pie chart:
    python result = df[df['metric'] == 'revenue'][['category', 'value']].rename(columns={'category': 'name'})
  • Multi-File Batch Processing: For generating multiple charts, use --charts-file with a JSON config to avoid shell escaping issues. The tool auto-merges files based on column overlap and outputs data_preview (first 10 rows) and plot_stats (full statistical summary) for validation.
  • Delivery with Annotation: After chart generation, a text interpretation based on plot_stats must be injected via --annotation into the HTML, ensuring deliverables include data insights.

Applicable Boundaries and Considerations

Despite its strengths, note these constraints:

  • Supported Scope: Single files up to 100 MB (recommended ≤50 MB) with auto-encoding detection; nested JSON beyond 1 level, real-time data, or non-tabular data (e.g., images) are not supported. Multi-file merging requires ≥50% column overlap.
  • CLI-Enforced Workflow: The data_parser.py → cli.py flow is mandatory—no custom scripts. Column renaming, aggregation, etc., must use --transform-code; parsing only handles header detection.
  • Transform Sandbox Security: Code execution is sandboxed; import, open, or class definitions are prohibited. Violations return structured errors with fixes. Transform is unnecessary if data already matches the chart format.
  • Chart Selection and Caliber: The tool auto-selects chart types based on data semantics (e.g., time-series as line), listing assumptions in delivery notes. Aggregation must clarify “by data row vs. by unique entity” (e.g., use drop_duplicates for course hours) to avoid caliber errors.
  • Delivery Standards: Each chart must include interpretation; numbers must be based on plot_stats or data_preview, with no exaggeration. No network dependency—ECharts JS is inlined into HTML for offline rendering.

Use Cases

  • When needing to merge sales data from multiple CSV files and generate a line chart of monthly trends, use smart-charts' multi-file merge and transform code to process data.
  • In an educational project, extract specific subject scores from JSON student performance data, aggregate them into category frequencies via transform, and create a pie chart showing score distribution.
  • To quickly produce project reports, convert Excel project progress files into ECharts dashboards, displaying KPI completion status in real-time without manual coding.
  • Processing survey CSV files from different sources, leverage auto-merging and chart generation to create interactive heatmaps analyzing response patterns.

Best For

  • Data analysts: need to quickly transform cleaned CSV data into visual charts to support business decision-making reports.
  • Education researchers: generate statistical charts from student performance JSON for academic analysis or teaching feedback.
  • Project managers: track progress data from multiple Excel project files, requiring interactive dashboards to monitor KPIs.
  • Market researchers: merge multiple survey questionnaire CSV data, generating charts to display consumer behavior trends.