Rust · egui 0.37 · mainFinancial charts.
Financial charts.
Your data.
Interactive financial charts for Rust and egui, built around your historical and streaming data.
Pan, zoom, explore. Your application supplies the real data.
FROM BARS TO A CHART
A widget in your application.
Create a chart once, give it your bars, and show it on every egui frame. The same Rust code runs natively and in WebAssembly.
This guide follows main (0.3 in development), using egui/eframe 0.37. Install the Git dependency below. Published release 0.2.0 uses egui/eframe 0.33.3.
cargo add egui-charts --git https://github.com/userFRM/egui-charts --branch maincargo add eframe@0.37 chrono@0.4// src/main.rsuse chrono::{TimeDelta, Utc};use eframe::egui;use egui_charts::{Chart, model::{Bar, BarData}};
fn main() -> eframe::Result { let start = Utc::now() - TimeDelta::minutes(2); let bars = vec![ Bar::new(start, 100.0, 103.0, 99.0, 102.0, 800.0), Bar::new(start + TimeDelta::minutes(1), 102.0, 104.0, 101.0, 103.0, 600.0), ]; let mut chart = Chart::new(BarData::from_bars(bars)); chart.set_symbol("SAMPLE");
eframe::run_ui_native("My chart", Default::default(), move |ui, _| { egui::CentralPanel::default().show(ui, |ui| chart.show(ui)); })}Learn the chart
Section titled “Learn the chart”InstallationChoose main (0.3 in development, egui 0.37) or the published 0.2.0 API (egui 0.33.3).
First chartPut a chart on screen, keep its state, replace history and update bars.
Builder tutorialConnect historical and streaming data, handle events, and save chart state.
main API (rustdoc)Browse types and methods for egui 0.37, with rustdoc's own symbol search.
Chart concepts
Section titled “Chart concepts”Series and chart typesChoose a renderer, add a series, and select shared or independent pricing.
Price scaleUse normal, logarithmic, percentage or indexed prices.
Time scale and whitespaceShare UTC viewports and reserve future whitespace. Use Bar::whitespace for missing observations.
Panes and markersPlace series and studies in panes, resize them, and attach event markers to bars.
Build your workspace
Section titled “Build your workspace”Studies and extensionsAdd custom studies, series primitives, drawing tools and themes.
RecipesPage history, stream bars, connect HTTP endpoints, save drawings and synchronize charts.
InteractionRespond to clicks, crosshair movement and visible-range changes.
StatusSee what works today and which capabilities still have gaps.
Your application owns market data connections, credentials, accounts and storage. egui-charts supplies the chart, analysis and host interfaces.