use embedded_charts::prelude::*;
#[path = "../common/mod.rs"]
mod common;
use common::{configs, data, layout, utils, WindowConfig};
#[cfg(feature = "std")]
fn main() -> ChartResult<()> {
let temperature_data = data::temperature_data(24)?;
let chart = configs::professional_line_chart(Rgb565::new(220 >> 3, 20 >> 2, 60 >> 3))?;
let legend = StandardLegendBuilder::new()
.position(LegendPos::Right)
.orientation(LegendOrientation::Vertical)
.add_line_entry("Temperature", Rgb565::new(220 >> 3, 20 >> 2, 60 >> 3))?
.professional_style()
.build()?;
let renderer = StandardLegendRenderer::new();
common::window::run(
WindowConfig::new("Temperature Monitor")
.theme(common::WindowTheme::Default)
.background(Rgb565::new(248 >> 3, 248 >> 2, 255 >> 3)), move |display, viewport, _time| {
layout::draw_chart_with_auto_legend(
|chart_area, display| {
chart.draw(&temperature_data, chart.config(), chart_area, display)
},
viewport,
display,
layout::ChartWithLegend::new(&legend, &renderer),
)?;
utils::print_series_info(&temperature_data, "Temperature");
println!("🌡️ Temperature range: 15°C to 30°C over 24 hours");
println!("📊 Chart shows realistic daily temperature cycle");
Ok(())
},
)
}
#[cfg(not(feature = "std"))]
fn main() {
utils::print_feature_requirement("std", "visual");
}