Skip to content

Youplala/chartgpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

title emoji colorFrom colorTo sdk pinned
ChartGPT
๐ŸŒ–
red
red
docker
false

๐Ÿ“Š ChartGPT

Transform Data into Insights with the Power of AI

Python Dash Docker HuggingFace

Try it Live โ€ข Documentation โ€ข Report Bug


๐ŸŽฏ What is ChartGPT?

Forget complex charting libraries and endless documentation. ChartGPT lets you create stunning, interactive visualizations by simply asking for what you want in plain English. Upload your CSV, ask a question, and watch as AI generates the perfect chart for your data.

You: "Show me a correlation heatmap of all numeric columns"
ChartGPT: *generates beautiful visualization + Python code*

No coding required. No chart selection headaches. Just data insights at the speed of thought.


โœจ Features

๐Ÿค– AI-Powered Magic

Natural language to beautiful charts. Powered by Qwen2.5-Coder-32B-Instruct for intelligent code generation.

๐ŸŽจ Dark Mode

Easy on the eyes. Toggle between light and dark themes with a single click.

๐Ÿ“ค Drag & Drop Upload

No complicated file pickers. Just drag your CSV and you're ready to go.

๐Ÿ” Code Transparency

See exactly how your chart was created. Every visualization comes with the Python code.

โšก Real-Time Preview

Interactive data tables with sorting, filtering, and search before you even create charts.

๐Ÿ”„ Iterative Refinement

Not happy with the result? Ask again and refine your visualization instantly.

๐Ÿณ Deploy Anywhere

Docker-ready. Deploy to Hugging Face Spaces, Heroku, Railway, or your own server in minutes.

๐ŸŽฏ Smart & Fast

Built with modern tech stack for lightning-fast responses and smooth interactions.


๐Ÿš€ How It Works

graph LR
    A[๐Ÿ“„ Upload CSV] --> B[๐Ÿ’ญ Ask Question]
    B --> C[๐Ÿค– AI Generates Code]
    C --> D[๐Ÿ“Š Beautiful Chart]
    D --> E[๐Ÿ”„ Refine or Export]
Loading

1๏ธโƒฃ Upload Your Data

Drag and drop any CSV file (up to 5MB). Instantly preview your data in an interactive table.

2๏ธโƒฃ Ask Your Question

Type naturally:

  • "Show me monthly revenue trends as a line chart"
  • "Create a bar chart comparing product categories"
  • "Plot the distribution of customer ages"
  • "Make a scatter plot of price vs. quantity sold"

3๏ธโƒฃ Get Instant Results

ChartGPT analyzes your data, writes the visualization code, and renders your chart in seconds. View the generated Python code anytime.


๐Ÿ› ๏ธ Tech Stack

Built with cutting-edge technologies for the best developer and user experience:


๐Ÿ’ป Installation

๐Ÿ Local Setup

Clone and run in under 2 minutes:

# Clone the repository
git clone https://github.com/yourusername/chartgpt.git
cd chartgpt

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set up your Hugging Face token
echo "HUGGINGFACE_API_KEY=your_token_here" > .env

# Launch the app
python app.py

๐ŸŽ‰ Open your browser to http://localhost:8050

๐Ÿณ Docker Setup

Even easier with Docker:

# Build the image
docker build -t chartgpt .

# Run the container
docker run -p 7860:7860 chartgpt

๐ŸŽ‰ Access at http://localhost:7860


๐ŸŽฎ Usage Tips

Tip Description
๐Ÿ’ก Be Specific "Line chart of sales over time" works better than "show sales"
๐Ÿ”„ Iterate Use "Ask again" to refine your visualizations
๐Ÿ“ File Size Keep CSVs under 5MB for optimal performance
๐ŸŽจ Explore Try different chart types: scatter, bar, line, pie, heatmap, etc.
๐Ÿ‘€ Inspect Code Learn from the generated Python code

๐Ÿ“ Project Structure

chartgpt/
โ”œโ”€โ”€ ๐Ÿ app.py                   # Main Dash application
โ”œโ”€โ”€ ๐Ÿ“ฆ requirements.txt         # Python dependencies
โ”œโ”€โ”€ ๐Ÿณ Dockerfile              # Container configuration
โ”œโ”€โ”€ ๐Ÿ“‚ assets/
โ”‚   โ”œโ”€โ”€ ๐ŸŒ™ logo_dark.svg       # Logo for light theme
โ”‚   โ”œโ”€โ”€ โ˜€๏ธ  logo_light.svg      # Logo for dark theme
โ”‚   โ””โ”€โ”€ ๐ŸŽจ custom.css          # Custom styling
โ””โ”€โ”€ ๐Ÿ“– README.md               # You are here!

๐Ÿ”ง Configuration

Customize the AI model in app.py (line 464):

# Switch to different models
chart = cg.Chart(df, model="huggingface/Qwen/Qwen2.5-Coder-32B-Instruct")

# Try other options:
# model="openai/gpt-4"
# model="anthropic/claude-3-sonnet"

๐Ÿš€ Deployment

Hugging Face Spaces (Recommended)

Perfect for sharing with the world:

  1. Create a new Space on Hugging Face
  2. Select Docker as the SDK
  3. Push your code to the Space repository
  4. Add your HUGGINGFACE_API_KEY in Settings โ†’ Repository secrets
  5. Your app goes live automatically!

Other Platforms

Deploy anywhere containers run:

Platform Method
๐Ÿš‚ Railway Connect GitHub repo, auto-deploy on push
๐ŸŸฃ Heroku Use included Dockerfile with Heroku Container Registry
โ˜๏ธ AWS/GCP/Azure Deploy as containerized web service
๐Ÿ–ฅ๏ธ VPS Run with gunicorn -b 0.0.0.0:7860 app:server

๐Ÿค Contributing

We love contributions! Here's how to get started:

# Fork the repo, then clone your fork
git clone https://github.com/YOUR_USERNAME/chartgpt.git

# Create a feature branch
git checkout -b feature/amazing-feature

# Make your changes and commit
git commit -m 'โœจ Add amazing feature'

# Push to your fork
git push origin feature/amazing-feature

# Open a Pull Request

๐Ÿ“œ License

This project is licensed under the MIT License โ€” feel free to use it however you'd like!


๐Ÿ™ Acknowledgments

Standing on the shoulders of giants:


๐Ÿ”— Connect

GitHub LinkedIn


Made with โค๏ธ and AI

Transform your data, one question at a time

About

Visualize your CSV in seconds by asking questions

Topics

Resources

Stars

Watchers

Forks