pub struct PlotArea {
pub charts: Vec<ChartType>,
pub axes: Vec<Axis>,
pub shape_properties: Option<ShapeProperties>,
}Expand description
The chart’s plot area (<c:plotArea>, CT_PlotArea) — one or more chart-type entries (the
schema allows overlaying series of different types on the same axes, e.g. a bar chart with a
line chart drawn over it), zero or more axes, and optional shape formatting.
Not modeled: <c:layout> (manual plot-area positioning), <c:dTable> (the data table sometimes
drawn under a chart).
Fields§
§charts: Vec<ChartType>§axes: Vec<Axis>§shape_properties: Option<ShapeProperties>Implementations§
Source§impl PlotArea
impl PlotArea
Sourcepub fn new() -> PlotArea
pub fn new() -> PlotArea
Examples found in repository?
examples/docx_images_and_charts.rs (line 61)
41fn sample_chart_space() -> ChartSpace {
42 let categories = StringData::new()
43 .with_point(StringPoint::new(0, "Q1"))
44 .with_point(StringPoint::new(1, "Q2"))
45 .with_point(StringPoint::new(2, "Q3"));
46 let values = NumericData::new()
47 .with_point(NumericPoint::new(0, "1200"))
48 .with_point(NumericPoint::new(1, "1350"))
49 .with_point(NumericPoint::new(2, "980"));
50
51 let series = BarSeries::new(0, 0)
52 .with_categories(AxisDataSource::String(StringDataSource::literal(
53 categories,
54 )))
55 .with_values(NumericDataSource::literal(values));
56
57 let bar_chart = BarChart::new(BarDirection::Column, 1, 2).with_series(series);
58 let category_axis = CategoryAxis::new(1, AxisPosition::Bottom, 2);
59 let value_axis = ValueAxis::new(2, AxisPosition::Left, 1);
60
61 let plot_area = PlotArea::new()
62 .with_chart(ChartType::Bar(bar_chart))
63 .with_axis(Axis::Category(category_axis))
64 .with_axis(Axis::Value(value_axis));
65
66 ChartSpace::new(Chart::new(plot_area))
67}More examples
examples/pptx_media.rs (line 101)
81fn sample_chart_space() -> ChartSpace {
82 let categories = StringData::new()
83 .with_point(StringPoint::new(0, "Q1"))
84 .with_point(StringPoint::new(1, "Q2"))
85 .with_point(StringPoint::new(2, "Q3"));
86 let values = NumericData::new()
87 .with_point(NumericPoint::new(0, "1200"))
88 .with_point(NumericPoint::new(1, "1350"))
89 .with_point(NumericPoint::new(2, "980"));
90
91 let series = BarSeries::new(0, 0)
92 .with_categories(AxisDataSource::String(StringDataSource::literal(
93 categories,
94 )))
95 .with_values(NumericDataSource::literal(values));
96
97 let bar_chart = BarChart::new(BarDirection::Column, 1, 2).with_series(series);
98 let category_axis = CategoryAxis::new(1, AxisPosition::Bottom, 2);
99 let value_axis = ValueAxis::new(2, AxisPosition::Left, 1);
100
101 let plot_area = PlotArea::new()
102 .with_chart(ChartType::Bar(bar_chart))
103 .with_axis(Axis::Category(category_axis))
104 .with_axis(Axis::Value(value_axis));
105
106 ChartSpace::new(Chart::new(plot_area))
107}examples/xlsx_images_and_charts.rs (line 73)
53fn sample_chart_space() -> ChartSpace {
54 let categories = StringData::new()
55 .with_point(StringPoint::new(0, "Q1"))
56 .with_point(StringPoint::new(1, "Q2"))
57 .with_point(StringPoint::new(2, "Q3"));
58 let values = NumericData::new()
59 .with_point(NumericPoint::new(0, "1200"))
60 .with_point(NumericPoint::new(1, "1350"))
61 .with_point(NumericPoint::new(2, "980"));
62
63 let series = BarSeries::new(0, 0)
64 .with_categories(AxisDataSource::String(StringDataSource::literal(
65 categories,
66 )))
67 .with_values(NumericDataSource::literal(values));
68
69 let bar_chart = BarChart::new(BarDirection::Column, 1, 2).with_series(series);
70 let category_axis = CategoryAxis::new(1, AxisPosition::Bottom, 2);
71 let value_axis = ValueAxis::new(2, AxisPosition::Left, 1);
72
73 let plot_area = PlotArea::new()
74 .with_chart(ChartType::Bar(bar_chart))
75 .with_axis(Axis::Category(category_axis))
76 .with_axis(Axis::Value(value_axis));
77
78 ChartSpace::new(Chart::new(plot_area))
79}Sourcepub fn with_chart(self, chart: ChartType) -> PlotArea
pub fn with_chart(self, chart: ChartType) -> PlotArea
Examples found in repository?
examples/docx_images_and_charts.rs (line 62)
41fn sample_chart_space() -> ChartSpace {
42 let categories = StringData::new()
43 .with_point(StringPoint::new(0, "Q1"))
44 .with_point(StringPoint::new(1, "Q2"))
45 .with_point(StringPoint::new(2, "Q3"));
46 let values = NumericData::new()
47 .with_point(NumericPoint::new(0, "1200"))
48 .with_point(NumericPoint::new(1, "1350"))
49 .with_point(NumericPoint::new(2, "980"));
50
51 let series = BarSeries::new(0, 0)
52 .with_categories(AxisDataSource::String(StringDataSource::literal(
53 categories,
54 )))
55 .with_values(NumericDataSource::literal(values));
56
57 let bar_chart = BarChart::new(BarDirection::Column, 1, 2).with_series(series);
58 let category_axis = CategoryAxis::new(1, AxisPosition::Bottom, 2);
59 let value_axis = ValueAxis::new(2, AxisPosition::Left, 1);
60
61 let plot_area = PlotArea::new()
62 .with_chart(ChartType::Bar(bar_chart))
63 .with_axis(Axis::Category(category_axis))
64 .with_axis(Axis::Value(value_axis));
65
66 ChartSpace::new(Chart::new(plot_area))
67}More examples
examples/pptx_media.rs (line 102)
81fn sample_chart_space() -> ChartSpace {
82 let categories = StringData::new()
83 .with_point(StringPoint::new(0, "Q1"))
84 .with_point(StringPoint::new(1, "Q2"))
85 .with_point(StringPoint::new(2, "Q3"));
86 let values = NumericData::new()
87 .with_point(NumericPoint::new(0, "1200"))
88 .with_point(NumericPoint::new(1, "1350"))
89 .with_point(NumericPoint::new(2, "980"));
90
91 let series = BarSeries::new(0, 0)
92 .with_categories(AxisDataSource::String(StringDataSource::literal(
93 categories,
94 )))
95 .with_values(NumericDataSource::literal(values));
96
97 let bar_chart = BarChart::new(BarDirection::Column, 1, 2).with_series(series);
98 let category_axis = CategoryAxis::new(1, AxisPosition::Bottom, 2);
99 let value_axis = ValueAxis::new(2, AxisPosition::Left, 1);
100
101 let plot_area = PlotArea::new()
102 .with_chart(ChartType::Bar(bar_chart))
103 .with_axis(Axis::Category(category_axis))
104 .with_axis(Axis::Value(value_axis));
105
106 ChartSpace::new(Chart::new(plot_area))
107}examples/xlsx_images_and_charts.rs (line 74)
53fn sample_chart_space() -> ChartSpace {
54 let categories = StringData::new()
55 .with_point(StringPoint::new(0, "Q1"))
56 .with_point(StringPoint::new(1, "Q2"))
57 .with_point(StringPoint::new(2, "Q3"));
58 let values = NumericData::new()
59 .with_point(NumericPoint::new(0, "1200"))
60 .with_point(NumericPoint::new(1, "1350"))
61 .with_point(NumericPoint::new(2, "980"));
62
63 let series = BarSeries::new(0, 0)
64 .with_categories(AxisDataSource::String(StringDataSource::literal(
65 categories,
66 )))
67 .with_values(NumericDataSource::literal(values));
68
69 let bar_chart = BarChart::new(BarDirection::Column, 1, 2).with_series(series);
70 let category_axis = CategoryAxis::new(1, AxisPosition::Bottom, 2);
71 let value_axis = ValueAxis::new(2, AxisPosition::Left, 1);
72
73 let plot_area = PlotArea::new()
74 .with_chart(ChartType::Bar(bar_chart))
75 .with_axis(Axis::Category(category_axis))
76 .with_axis(Axis::Value(value_axis));
77
78 ChartSpace::new(Chart::new(plot_area))
79}Sourcepub fn with_axis(self, axis: Axis) -> PlotArea
pub fn with_axis(self, axis: Axis) -> PlotArea
Examples found in repository?
examples/docx_images_and_charts.rs (line 63)
41fn sample_chart_space() -> ChartSpace {
42 let categories = StringData::new()
43 .with_point(StringPoint::new(0, "Q1"))
44 .with_point(StringPoint::new(1, "Q2"))
45 .with_point(StringPoint::new(2, "Q3"));
46 let values = NumericData::new()
47 .with_point(NumericPoint::new(0, "1200"))
48 .with_point(NumericPoint::new(1, "1350"))
49 .with_point(NumericPoint::new(2, "980"));
50
51 let series = BarSeries::new(0, 0)
52 .with_categories(AxisDataSource::String(StringDataSource::literal(
53 categories,
54 )))
55 .with_values(NumericDataSource::literal(values));
56
57 let bar_chart = BarChart::new(BarDirection::Column, 1, 2).with_series(series);
58 let category_axis = CategoryAxis::new(1, AxisPosition::Bottom, 2);
59 let value_axis = ValueAxis::new(2, AxisPosition::Left, 1);
60
61 let plot_area = PlotArea::new()
62 .with_chart(ChartType::Bar(bar_chart))
63 .with_axis(Axis::Category(category_axis))
64 .with_axis(Axis::Value(value_axis));
65
66 ChartSpace::new(Chart::new(plot_area))
67}More examples
examples/pptx_media.rs (line 103)
81fn sample_chart_space() -> ChartSpace {
82 let categories = StringData::new()
83 .with_point(StringPoint::new(0, "Q1"))
84 .with_point(StringPoint::new(1, "Q2"))
85 .with_point(StringPoint::new(2, "Q3"));
86 let values = NumericData::new()
87 .with_point(NumericPoint::new(0, "1200"))
88 .with_point(NumericPoint::new(1, "1350"))
89 .with_point(NumericPoint::new(2, "980"));
90
91 let series = BarSeries::new(0, 0)
92 .with_categories(AxisDataSource::String(StringDataSource::literal(
93 categories,
94 )))
95 .with_values(NumericDataSource::literal(values));
96
97 let bar_chart = BarChart::new(BarDirection::Column, 1, 2).with_series(series);
98 let category_axis = CategoryAxis::new(1, AxisPosition::Bottom, 2);
99 let value_axis = ValueAxis::new(2, AxisPosition::Left, 1);
100
101 let plot_area = PlotArea::new()
102 .with_chart(ChartType::Bar(bar_chart))
103 .with_axis(Axis::Category(category_axis))
104 .with_axis(Axis::Value(value_axis));
105
106 ChartSpace::new(Chart::new(plot_area))
107}examples/xlsx_images_and_charts.rs (line 75)
53fn sample_chart_space() -> ChartSpace {
54 let categories = StringData::new()
55 .with_point(StringPoint::new(0, "Q1"))
56 .with_point(StringPoint::new(1, "Q2"))
57 .with_point(StringPoint::new(2, "Q3"));
58 let values = NumericData::new()
59 .with_point(NumericPoint::new(0, "1200"))
60 .with_point(NumericPoint::new(1, "1350"))
61 .with_point(NumericPoint::new(2, "980"));
62
63 let series = BarSeries::new(0, 0)
64 .with_categories(AxisDataSource::String(StringDataSource::literal(
65 categories,
66 )))
67 .with_values(NumericDataSource::literal(values));
68
69 let bar_chart = BarChart::new(BarDirection::Column, 1, 2).with_series(series);
70 let category_axis = CategoryAxis::new(1, AxisPosition::Bottom, 2);
71 let value_axis = ValueAxis::new(2, AxisPosition::Left, 1);
72
73 let plot_area = PlotArea::new()
74 .with_chart(ChartType::Bar(bar_chart))
75 .with_axis(Axis::Category(category_axis))
76 .with_axis(Axis::Value(value_axis));
77
78 ChartSpace::new(Chart::new(plot_area))
79}pub fn with_shape_properties(self, properties: ShapeProperties) -> PlotArea
Trait Implementations§
impl StructuralPartialEq for PlotArea
Auto Trait Implementations§
impl Freeze for PlotArea
impl RefUnwindSafe for PlotArea
impl Send for PlotArea
impl Sync for PlotArea
impl Unpin for PlotArea
impl UnsafeUnpin for PlotArea
impl UnwindSafe for PlotArea
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