pub struct Groupby<'a> { /* private fields */ }
Implementations§
Source§impl<'a> Groupby<'a>
impl<'a> Groupby<'a>
Sourcepub fn enabled(&mut self, enabled: bool) -> &mut Self
pub fn enabled(&mut self, enabled: bool) -> &mut Self
Determines whether this group-by transform is enabled or disabled.
default: true
Sourcepub fn groups(&mut self, groups: &'a [f64]) -> &mut Self
pub fn groups(&mut self, groups: &'a [f64]) -> &mut Self
Sets the groups in which the trace data will be split. For example, with x
set to [1, 2, 3, 4] and groups
set to [‘a’, ‘b’, ‘a’, ‘b’], the groupby transform with split in one trace with x
[1, 3] and one trace with x
[2, 4].
default: []
Sourcepub fn nameformat(&mut self, nameformat: &'a str) -> &mut Self
pub fn nameformat(&mut self, nameformat: &'a str) -> &mut Self
Pattern by which grouped traces are named. If only one trace is present, defaults to the group name ("%{group}"
), otherwise defaults to the group name with trace name ("%{group} (%{trace})"
). Available escape sequences are %{group}
, which inserts the group name, and %{trace}
, which inserts the trace name. If grouping GDP data by country when more than one trace is present, for example, the default “%{group} (%{trace})” would return “Monaco (GDP per capita)”.