AgentStack
SKILL verified MIT Self-run

Chart Generator

skill-prasad-nimbalkar-claude-agent-skills-chart-generator · by prasad-nimbalkar

Use this skill when asked to create a chart, graph, plot, or data visualization from data. Triggers: 'make a chart from this', 'plot this data', 'visualize this CSV', 'create a bar/line/pie chart', 'show me a graph of...', 'generate a dashboard'. Outputs publication-quality PNG/HTML charts.

No reviews yet
0 installs
11 views
0.0% view→install

Install

$ agentstack add skill-prasad-nimbalkar-claude-agent-skills-chart-generator

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Chart Generator? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Chart Generator

Why this skill exists

Choosing the wrong chart type is the most common data visualization mistake. This skill picks the right chart for the data shape and produces clean, labeled, publication-quality output — not matplotlib defaults.

When to use

  • User has data (CSV, JSON, or described) and wants it visualized
  • User requests a specific chart type
  • User wants to generate charts for a report or presentation

Step-by-step procedure

Step 1 — Pick the right chart type

| Data shape | Best chart | |---|---| | One number over time | Line chart | | Comparing categories | Bar chart (vertical) or horizontal bar | | Part-of-whole ( 5 slices — use a bar chart instead. Never use 3D charts — they distort perception.**

Step 2 — Load data

import pandas as pd
import json

# From CSV
df = pd.read_csv("/mnt/user-data/uploads/data.csv")

# From JSON
with open("/mnt/user-data/uploads/data.json") as f:
    data = json.load(f)
df = pd.DataFrame(data)

# From user-described data (build inline)
df = pd.DataFrame({
    "Month": ["Jan", "Feb", "Mar", "Apr", "May"],
    "Revenue": [12000, 15000, 13500, 18000, 21000],
})

Step 3 — Generate charts

Bar chart:

import matplotlib.pyplot as plt
import matplotlib.ticker as mticker

fig, ax = plt.subplots(figsize=(10, 6))
bars = ax.bar(df["Category"], df["Value"], color="#4F86C6", edgecolor="white", linewidth=0.5)

# Labels on bars
for bar in bars:
    height = bar.get_height()
    ax.text(bar.get_x() + bar.get_width()/2, height + 0.5,
            f"{height:,.0f}", ha="center", va="bottom", fontsize=10)

ax.set_title("Category Comparison", fontsize=16, fontweight="bold", pad=15)
ax.set_xlabel("Category", fontsize=12)
ax.set_ylabel("Value", fontsize=12)
ax.yaxis.set_major_formatter(mticker.FuncFormatter(lambda x, _: f"{x:,.0f}"))
ax.spines[["top", "right"]].set_visible(False)
ax.set_facecolor("#fafafa")
fig.tight_layout()
plt.savefig("/mnt/user-data/outputs/bar_chart.png", dpi=150, bbox_inches="tight")
plt.close()

Line chart (time series):

fig, ax = plt.subplots(figsize=(12, 6))
ax.plot(df["Date"], df["Value"], color="#2E86AB", linewidth=2.5, marker="o", markersize=5)
ax.fill_between(df["Date"], df["Value"], alpha=0.1, color="#2E86AB")

ax.set_title("Trend Over Time", fontsize=16, fontweight="bold", pad=15)
ax.set_xlabel("Date", fontsize=12)
ax.set_ylabel("Value", fontsize=12)
ax.spines[["top", "right"]].set_visible(False)
plt.xticks(rotation=45)
fig.tight_layout()
plt.savefig("/mnt/user-data/outputs/line_chart.png", dpi=150, bbox_inches="tight")
plt.close()

Scatter plot:

fig, ax = plt.subplots(figsize=(9, 7))
scatter = ax.scatter(df["x"], df["y"], c=df.get("group", "#4F86C6"),
                     alpha=0.7, s=60, edgecolors="white", linewidth=0.5)

ax.set_title("Correlation Analysis", fontsize=16, fontweight="bold", pad=15)
ax.set_xlabel("X Variable", fontsize=12)
ax.set_ylabel("Y Variable", fontsize=12)
ax.spines[["top", "right"]].set_visible(False)
fig.tight_layout()
plt.savefig("/mnt/user-data/outputs/scatter.png", dpi=150, bbox_inches="tight")
plt.close()

Heatmap (correlation matrix):

import seaborn as sns

corr = df.select_dtypes(include="number").corr()
fig, ax = plt.subplots(figsize=(10, 8))
sns.heatmap(corr, annot=True, fmt=".2f", cmap="RdYlGn",
            center=0, linewidths=0.5, ax=ax,
            annot_kws={"size": 10})
ax.set_title("Correlation Matrix", fontsize=16, fontweight="bold", pad=15)
fig.tight_layout()
plt.savefig("/mnt/user-data/outputs/heatmap.png", dpi=150, bbox_inches="tight")
plt.close()

Interactive chart with Plotly (HTML output):

import plotly.express as px

fig = px.bar(df, x="Category", y="Value", color="Group",
             title="Interactive Bar Chart",
             template="plotly_white",
             color_discrete_sequence=px.colors.qualitative.Set2)

fig.update_layout(font_family="Arial", title_font_size=18)
fig.write_html("/mnt/user-data/outputs/chart.html")
print("Interactive chart saved as HTML")

Step 4 — Multi-chart dashboard

fig, axes = plt.subplots(2, 2, figsize=(14, 10))
fig.suptitle("Data Dashboard", fontsize=18, fontweight="bold", y=1.02)

# Add each chart to a subplot
# axes[0][0] = chart 1, axes[0][1] = chart 2, etc.

plt.tight_layout()
plt.savefig("/mnt/user-data/outputs/dashboard.png", dpi=150, bbox_inches="tight")

Edge cases

| Situation | Fix | |-----------|-----| | Dates not parsed | pd.to_datetime(df["date"]) | | Too many categories (> 15) | Use horizontal bar + show top N + "Other" | | Negative values in bar chart | Set ax.axhline(0, color="black", linewidth=0.8) | | Very different scales | Use dual Y-axis with ax.twinx() | | Missing values in time series | df.interpolate() or show gaps explicitly | | Matplotlib not installed | pip install matplotlib seaborn plotly --break-system-packages |

Output format

Always report:

  • Chart type chosen and why
  • X/Y axes and what they represent
  • Output file path(s)
  • Key insight from the chart (1 sentence: "Revenue peaks in Q4 with $21k")

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.