Expand description
Common types and extension traits for embedding a chart.
Implement a feed with the same imports used to embed a chart:
use egui_charts::prelude::*;
struct Feed;
impl Datafeed for Feed {
fn history(&self, _: HistoryRequest, reply: Reply<HistoryPage>) {
reply.send(Ok(HistoryPage::new(Vec::new(), true)));
}
fn subscribe(&self, _: Subscription) {}
}use egui_charts::prelude::*;
let bars = vec![Bar::new(
chrono::Utc::now(), 100.0, 102.0, 99.0, 101.0, 10.0,
)];
let mut chart = ChartBuilder::new().build();
chart.set_data(SeriesId::MAIN, bars);Re-exportsยง
pub use crate::data::Datafeed;pub use crate::data::FeedError;pub use crate::data::HistoryPage;pub use crate::data::HistoryRequest;pub use crate::data::Reply;pub use crate::data::Sink;pub use crate::data::Subscription;pub use crate::model::Bar;pub use crate::model::BarData;pub use crate::model::ChartType;pub use crate::model::Instrument;pub use crate::model::LineStyle;pub use crate::model::OrderSide;pub use crate::model::Timeframe;pub use crate::studies::CustomIndicator;pub use crate::studies::Indicator;pub use crate::studies::IndicatorValue;pub use crate::studies::StudyError;pub use crate::config::ChartConfig;pub use crate::config::ChartOptions;pub use crate::theme::Theme;pub use crate::theme::ThemeExt;pub use crate::widget::Chart;pub use crate::widget::ChartBuilder;pub use crate::widget::SeriesId;pub use crate::widget::settings::ChartSettingsState;