Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion egui_plot/src/items/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ macro_rules! builder_methods_for_base {
/// Name of this plot item.
///
/// This name will show up in the plot legend, if legends are turned on.
///
/// Setting the name via this method does not change the item's id, so you can use it to
/// change the name dynamically between frames without losing the item's state. You should
/// make sure the name passed to [`Self::new`] is unique and stable for each item, or
/// set unique and stable ids explicitly via [`Self::id`].
#[inline]
pub fn name(mut self, name: impl ToString) -> Self {
self.base_mut().name = name.to_string();
Expand All @@ -78,7 +83,8 @@ macro_rules! builder_methods_for_base {

/// Sets the id of this plot item.
///
/// By default the id is determined from the name, but it can be explicitly set to a different value.
/// By default the id is determined from the name passed to [`Self::new`], but it can be
/// explicitly set to a different value.
#[inline]
pub fn id(mut self, id: impl Into<Id>) -> Self {
self.base_mut().id = id.into();
Expand Down
Loading