Embedded Charts
A production-ready, no_std graph framework for embedded systems using embedded-graphics.
This library provides comprehensive chart types (line, bar, pie), axes, grids, legends, real-time data streaming capabilities, and customizable styling while maintaining memory efficiency and performance suitable for resource-constrained environments.
🎨 Visual Showcase
Professional Theme Collection
Complete collection of all professional color themes optimized for different display types and use cases
Chart Type Gallery
Animated Chart Demonstrations
🚀 Production Ready Features
✅ Complete Chart Types
- Line Charts: Multi-series support, markers (circle, square, triangle, diamond), area filling
- Bar Charts: Vertical/horizontal, stacked bars, custom colors and spacing
- Pie Charts: Full circles, donut charts, custom colors and labels
- Gauge Charts: ✅ COMPLETE - Semicircle/full circle gauges, threshold zones, needle animations, custom indicators
- Scatter Charts: ✅ COMPLETE - Bubble charts, size/color mapping, collision detection, multiple point shapes
✅ Advanced Rendering
- Axes System: Linear axes with customizable ticks, labels, and formatting
- Grid System: Major/minor grids, tick-aligned grids, custom spacing
- Legend System: Multiple orientations, custom styling, automatic positioning
- Triangle Filling: Efficient area filling algorithms for complex shapes
✅ Professional Styling
- Color Palettes: Professional, pastel, and custom color schemes
- Themes: Built-in themes optimized for different display types
- Typography: Font support with customizable text rendering
- Markers: Circle, square, triangle, diamond shapes with custom sizes
✅ Memory Efficiency
- Static Allocation: Compile-time memory bounds, no heap usage
- Configurable Capacity: Adjust memory usage per application needs
- no_std Compatible: Full compatibility with embedded environments
- Zero-cost Abstractions: High-level API with no runtime overhead
✅ Real-time Animation
- Streaming Data: Live data updates with smooth transitions
- Animation System: Configurable easing functions and timing
- Auto-redraw: Automatic chart updates for dynamic data
- Performance Optimized: Efficient rendering for resource-constrained systems
📊 Feature Matrix
| Feature | Status | Description |
|---|---|---|
| Line Charts | ✅ Complete | Multi-series, markers, area filling |
| Bar Charts | ✅ Complete | Vertical/horizontal, stacked support |
| Pie Charts | ✅ Complete | Full circles, donut charts |
| Gauge Charts | ✅ Complete | Semicircle gauges, threshold zones |
| Scatter Charts | ✅ Complete | Clustering, collision detection |
| Axes System | ✅ Complete | Linear axes, ticks, labels |
| Grid System | ✅ Complete | Major/minor grids, alignment |
| Legend System | ✅ Complete | Multiple layouts, styling |
| Color Palettes | ✅ Complete | Professional color schemes |
| Memory Management | ✅ Complete | Static allocation, configurable |
| no_std Support | ✅ Complete | Full embedded compatibility |
| Triangle Filling | ✅ Complete | Efficient area rendering |
| Streaming Animation | ✅ Complete | Real-time animated charts |
🛠️ Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
= "0.8"
Feature Flags
Configure the library for your target system:
[]
= {
version = "0.1.0",
= ["color-support", "fonts"]
}
Chart Features
basic-charts: Line, bar, pie charts (default)advanced-charts: Scatter plots, gauges, custom chartsstacked-charts: Stacked bar and area chart supportdonut: Donut chart support
Rendering Features
color-support: RGB color palettes and themesfonts: Text rendering and typographyanti-aliasing: Smooth line rendering (requires micromath)animations: Real-time animations and transitionscapture: Screenshot and GIF capture for documentation (std only)
🚀 Quick Start
Basic Line Chart
use *;
use ;
// Create sample data
let data = data_points!;
// Build a line chart
let chart = builder
.line_color
.line_width
.with_markers
.build?;
// Configure the chart
let config = chart_config! ;
// Render to display
chart.draw?;
Professional Multi-Series Chart
use *;
// Create multiple data series
let temp_data = data_points!;
let humidity_data = data_points!;
// Create multi-series container
let mut multi_series = new;
multi_series.add_series?;
multi_series.add_series?;
// Build chart with professional styling
let chart = professional_line_chart
.with_legend
.with_axes
.build?;
chart.draw?;
Real-time Dashboard
use *;
// Create streaming data series
let mut streaming_data = new;
// Simulate real-time data
for i in 0..50
// Create real-time chart
let chart = builder
.line_color
.line_width
.fill_area // Semi-transparent green
.with_grid
.build?;
chart.draw?;
Interactive Scatter Plot
use *;
// Create scatter plot data with categories
let mut data_series = new;
data_series.push?; // High Performance
data_series.push?; // High Performance
data_series.push?; // Medium Performance
data_series.push?; // Budget
// Build scatter chart with advanced features
let chart = builder
.point_shape
.point_size
.color_mapping
.collision_detection
.with_connections // Connect related points
.with_title
.background_color
.build?;
chart.draw?;
🔧 no_std Embedded Usage
The library is fully compatible with no_std environments and provides optimized configurations for embedded systems. Here's how to use charts in constrained embedded systems:
Basic no_std Line Chart
use ;
use *;
// Create data series with static allocation
let mut sensor_data: = new;
// Add temperature readings
let _ = sensor_data.push;
let _ = sensor_data.push;
let _ = sensor_data.push;
let _ = sensor_data.push;
// Create minimal chart for small displays
let chart = builder
.line_color
.line_width
.margins
.build?;
// Render to embedded display
let viewport = new;
chart.draw?;
📱 Supported Displays
- OLED Displays: SSD1306, SH1106, and compatible
- TFT Displays: ST7735, ILI9341, and RGB565 compatible
- E-Paper: Waveshare and compatible e-ink displays
- Custom Displays: Any display implementing embedded-graphics traits
🚀 Getting Started
- Add the dependency to your
Cargo.toml - Choose appropriate features for your system
- Import the prelude:
use embedded_charts::prelude::*; - Create your data and chart
- Render to your display
📚 Documentation
🤝 Contributing
Contributions are welcome! Please see our Contributing Guide for details.
📄 License
This project is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
🏆 Acknowledgments
- Built on top of the excellent embedded-graphics crate
- Inspired by the needs of the embedded Rust community
- Special thanks to all contributors and testers