pub struct XyChartData { /* private fields */ }Expand description
Accumulates data for XY (scatter) charts.
§Example
use pptx::chart::data::XyChartData;
let mut chart_data = XyChartData::new();
let mut series = chart_data.add_series("Measurements");
series.add_data_point(1.0, 2.5);
series.add_data_point(3.0, 4.0);Implementations§
Source§impl XyChartData
impl XyChartData
Sourcepub fn add_series(&mut self, name: &str) -> &mut XySeriesData
pub fn add_series(&mut self, name: &str) -> &mut XySeriesData
Add a series and return a mutable reference to populate its data points.
§Panics
This method will not panic; the internal unwrap() is safe because
an element was just pushed.
Sourcepub fn series(&self) -> &[XySeriesData]
pub fn series(&self) -> &[XySeriesData]
Get the series data.
Sourcepub fn number_format(&self) -> &str
pub fn number_format(&self) -> &str
Get the number format.
Sourcepub fn to_xml(&self, chart_type: XlChartType) -> PptxResult<String>
pub fn to_xml(&self, chart_type: XlChartType) -> PptxResult<String>
Generate chart XML for the given chart type.
§Errors
Returns an error if the chart type is unsupported or XML generation fails.
Trait Implementations§
Source§impl Clone for XyChartData
impl Clone for XyChartData
Source§fn clone(&self) -> XyChartData
fn clone(&self) -> XyChartData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for XyChartData
impl Debug for XyChartData
Auto Trait Implementations§
impl Freeze for XyChartData
impl RefUnwindSafe for XyChartData
impl Send for XyChartData
impl Sync for XyChartData
impl Unpin for XyChartData
impl UnsafeUnpin for XyChartData
impl UnwindSafe for XyChartData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more