Skip to content

Commit 7bea6b0

Browse files
committed
Showing more detail in the legend
1 parent d665e7e commit 7bea6b0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use eframe::{egui, NativeOptions, egui::Color32, egui::ColorImage};
1010
use std::process::Command as process_command;
1111
use std::path::PathBuf;
1212
use std::sync::mpsc::{Sender, Receiver};
13-
use egui_plot::{Plot, PlotPoints, Line};
13+
use egui_plot::{Plot, PlotPoints, Line, Legend};
1414
use chrono::Local;
1515
use std::sync::Arc;
1616

@@ -397,6 +397,7 @@ impl MyApp {
397397
.width(ui.available_width())
398398
.x_axis_label("Sample No")
399399
.y_axis_label("Value")
400+
.legend(Legend::default())
400401
.show(ui, |plot_ui| {
401402
// 2. Generate a unique color for the line based on its address.
402403
let color = Color32::from_rgb(
@@ -410,7 +411,7 @@ impl MyApp {
410411
let line = Line::new(PlotPoints::from(points_vec))
411412
.name(&plot_title)
412413
.color(color);
413-
414+
414415
plot_ui.line(line);
415416
});
416417

0 commit comments

Comments
 (0)