Installation
This guide follows main (0.3 in development). Use Rust 1.95 or newer and egui/eframe 0.37 so both dependencies share the same egui types.
| Documentation | Dependency | egui / eframe |
|---|---|---|
| main API (rustdoc) · 0.3 in development | Git, branch main | 0.37 |
| Published 0.2.0 API | egui-charts = "0.2.0" | 0.33.3 |
-
Create your application.
Terminal window cargo new my-chartcd my-chart -
Choose your dependencies.
Use the widget alone for a chart, the default features for a larger interface, or the headless engine for data processing without egui.
Cargo.toml [dependencies]egui-charts = { git = "https://github.com/userFRM/egui-charts", branch = "main", default-features = false, features = ["widget"] }eframe = "0.37"chrono = "0.4"Cargo.toml [dependencies]egui-charts = { git = "https://github.com/userFRM/egui-charts", branch = "main" }eframe = "0.37"chrono = "0.4"Cargo.toml [dependencies]egui-charts = { git = "https://github.com/userFRM/egui-charts", branch = "main", default-features = false }chrono = "0.4" -
Check the setup.
Terminal window cargo checkContinue with your first chart to display bars in a native window.
Enable what your application uses
Section titled “Enable what your application uses”| Feature | What it enables |
|---|---|
widget | The egui chart, configuration and theme system |
studies | Built-in studies and IndicatorFactory; also works headlessly |
alert-engine | services::AlertEngine, which evaluates alerts on the bars the host feeds it; also works headlessly |
detectors | services::OrderFlowDetectors, which finds order-flow events in the trades and depth the host feeds it; also works headlessly |
strategies | strategies::Backtest, which runs a strategies::Strategy over bars and returns a StrategyReport; also works headlessly |
http | data::http::HttpDatafeed, HTTP column history, symbol search and live bar refresh from your server; also works headlessly |
drawings | Drawing tools, interaction, undo and persistence; enables widget |
icons | Embedded SVG icons; enables widget |
csv | CSV import and export for bars, strategy reports and chart data |
png-export | PNG image export and image textures in SVG export; enables widget |
ui | Toolbars, panels, dialogs, ui_kit and extension helpers; enables icons, studies, drawings, csv and png-export |
locales | Localized month and weekday names and AM/PM markers |
timezones | IANA zones and daylight-saving rules |
serde | Serialization for Theme |
The defaults are ui, locales, timezones, csv and png-export. Omit default-features = false
and the explicit feature list for that setup. Add studies or drawings to the
widget-only list for those capabilities without the full application UI. Without
default features, add csv or png-export for CSV or PNG methods. With icons
alone, the chart installs only its embedded icon loader.
With default-features = false and no features, the headless engine provides
models, data contracts, scales, services and the indicator trait layer without egui.
Native and browser hosts
Section titled “Native and browser hosts”The widget runs in an egui host. The first chart uses eframe. The repository’s demo shows an eframe WebAssembly app built with Trunk. Host windowing, event loops, network runtimes and browser startup remain application concerns.