umya_spreadsheet/structs/drawing/charts/
plot_area.rs

1// c:plotArea
2use super::Area3DChart;
3use super::AreaChart;
4use super::AreaChartSeriesList;
5use super::Bar3DChart;
6use super::BarChart;
7use super::BubbleChart;
8use super::CategoryAxis;
9use super::DoughnutChart;
10use super::Formula;
11use super::GroupingValues;
12use super::Layout;
13use super::Line3DChart;
14use super::LineChart;
15use super::OfPieChart;
16use super::Pie3DChart;
17use super::PieChart;
18use super::RadarChart;
19use super::ScatterChart;
20use super::SeriesAxis;
21use super::ShapeProperties;
22use super::ValueAxis;
23use crate::drawing::charts::DateAxis;
24use crate::structs::Spreadsheet;
25use crate::traits::AdjustmentCoordinateWithSheet;
26use crate::writer::driver::*;
27use crate::xml_read_loop;
28use quick_xml::events::{BytesStart, Event};
29use quick_xml::Reader;
30use quick_xml::Writer;
31use std::io::Cursor;
32use thin_vec::ThinVec;
33
34#[derive(Clone, Default, Debug)]
35pub struct PlotArea {
36    layout: Layout,
37    line_chart: Option<LineChart>,
38    line_3d_chart: Option<Line3DChart>,
39    pie_chart: Option<PieChart>,
40    pie_3d_chart: Option<Pie3DChart>,
41    doughnut_chart: Option<DoughnutChart>,
42    scatter_chart: Option<ScatterChart>,
43    bar_chart: Option<BarChart>,
44    bar_3d_chart: Option<Bar3DChart>,
45    radar_chart: Option<RadarChart>,
46    bubble_chart: Option<BubbleChart>,
47    area_chart: Option<AreaChart>,
48    area_3d_chart: Option<Area3DChart>,
49    of_pie_chart: Option<OfPieChart>,
50    category_axis: ThinVec<CategoryAxis>,
51    date_axis: ThinVec<DateAxis>,
52    value_axis: ThinVec<ValueAxis>,
53    series_axis: ThinVec<SeriesAxis>,
54    shape_properties: Option<ShapeProperties>,
55}
56
57impl PlotArea {
58    pub fn get_layout(&self) -> &Layout {
59        &self.layout
60    }
61
62    pub fn get_layout_mut(&mut self) -> &mut Layout {
63        &mut self.layout
64    }
65
66    pub fn set_layout(&mut self, value: Layout) -> &mut Self {
67        self.layout = value;
68        self
69    }
70
71    pub fn get_line_chart(&self) -> Option<&LineChart> {
72        self.line_chart.as_ref()
73    }
74
75    pub fn get_line_chart_mut(&mut self) -> Option<&mut LineChart> {
76        self.line_chart.as_mut()
77    }
78
79    pub fn set_line_chart(&mut self, value: LineChart) -> &mut Self {
80        self.line_chart = Some(value);
81        self
82    }
83
84    pub fn get_line_3d_chart(&self) -> Option<&Line3DChart> {
85        self.line_3d_chart.as_ref()
86    }
87
88    pub fn get_line_3d_chart_mut(&mut self) -> Option<&mut Line3DChart> {
89        self.line_3d_chart.as_mut()
90    }
91
92    pub fn set_line_3d_chart(&mut self, value: Line3DChart) -> &mut Self {
93        self.line_3d_chart = Some(value);
94        self
95    }
96
97    pub fn get_pie_chart(&self) -> Option<&PieChart> {
98        self.pie_chart.as_ref()
99    }
100
101    pub fn get_pie_chart_mut(&mut self) -> Option<&mut PieChart> {
102        self.pie_chart.as_mut()
103    }
104
105    pub fn set_pie_chart(&mut self, value: PieChart) -> &mut Self {
106        self.pie_chart = Some(value);
107        self
108    }
109
110    pub fn get_pie_3d_chart(&self) -> Option<&Pie3DChart> {
111        self.pie_3d_chart.as_ref()
112    }
113
114    pub fn get_pie_3d_chart_mut(&mut self) -> Option<&mut Pie3DChart> {
115        self.pie_3d_chart.as_mut()
116    }
117
118    pub fn set_pie_3d_chart(&mut self, value: Pie3DChart) -> &mut Self {
119        self.pie_3d_chart = Some(value);
120        self
121    }
122
123    pub fn get_doughnut_chart(&self) -> Option<&DoughnutChart> {
124        self.doughnut_chart.as_ref()
125    }
126
127    pub fn get_doughnut_chart_mut(&mut self) -> Option<&mut DoughnutChart> {
128        self.doughnut_chart.as_mut()
129    }
130
131    pub fn set_doughnut_chart(&mut self, value: DoughnutChart) -> &mut Self {
132        self.doughnut_chart = Some(value);
133        self
134    }
135
136    pub fn get_scatter_chart(&self) -> Option<&ScatterChart> {
137        self.scatter_chart.as_ref()
138    }
139
140    pub fn get_scatter_chart_mut(&mut self) -> Option<&mut ScatterChart> {
141        self.scatter_chart.as_mut()
142    }
143
144    pub fn set_scatter_chart(&mut self, value: ScatterChart) -> &mut Self {
145        self.scatter_chart = Some(value);
146        self
147    }
148
149    pub fn get_bar_chart(&self) -> Option<&BarChart> {
150        self.bar_chart.as_ref()
151    }
152
153    pub fn get_bar_chart_mut(&mut self) -> Option<&mut BarChart> {
154        self.bar_chart.as_mut()
155    }
156
157    pub fn set_bar_chart(&mut self, value: BarChart) -> &mut Self {
158        self.bar_chart = Some(value);
159        self
160    }
161
162    pub fn get_bar_3d_chart(&self) -> Option<&Bar3DChart> {
163        self.bar_3d_chart.as_ref()
164    }
165
166    pub fn get_bar_3d_chart_mut(&mut self) -> Option<&mut Bar3DChart> {
167        self.bar_3d_chart.as_mut()
168    }
169
170    pub fn set_bar_3d_chart(&mut self, value: Bar3DChart) -> &mut Self {
171        self.bar_3d_chart = Some(value);
172        self
173    }
174
175    pub fn get_radar_chart(&self) -> Option<&RadarChart> {
176        self.radar_chart.as_ref()
177    }
178
179    pub fn get_radar_chart_mut(&mut self) -> Option<&mut RadarChart> {
180        self.radar_chart.as_mut()
181    }
182
183    pub fn set_radar_chart(&mut self, value: RadarChart) -> &mut Self {
184        self.radar_chart = Some(value);
185        self
186    }
187
188    pub fn get_bubble_chart(&self) -> Option<&BubbleChart> {
189        self.bubble_chart.as_ref()
190    }
191
192    pub fn get_bubble_chart_mut(&mut self) -> Option<&mut BubbleChart> {
193        self.bubble_chart.as_mut()
194    }
195
196    pub fn set_bubble_chart(&mut self, value: BubbleChart) -> &mut Self {
197        self.bubble_chart = Some(value);
198        self
199    }
200
201    pub fn get_area_chart(&self) -> Option<&AreaChart> {
202        self.area_chart.as_ref()
203    }
204
205    pub fn get_area_chart_mut(&mut self) -> Option<&mut AreaChart> {
206        self.area_chart.as_mut()
207    }
208
209    pub fn set_area_chart(&mut self, value: AreaChart) -> &mut Self {
210        self.area_chart = Some(value);
211        self
212    }
213
214    pub fn get_area_3d_chart(&self) -> Option<&Area3DChart> {
215        self.area_3d_chart.as_ref()
216    }
217
218    pub fn get_area_3d_chart_mut(&mut self) -> Option<&mut Area3DChart> {
219        self.area_3d_chart.as_mut()
220    }
221
222    pub fn set_area_3d_chart(&mut self, value: Area3DChart) -> &mut Self {
223        self.area_3d_chart = Some(value);
224        self
225    }
226
227    pub fn get_of_pie_chart(&self) -> Option<&OfPieChart> {
228        self.of_pie_chart.as_ref()
229    }
230
231    pub fn get_of_pie_chart_mut(&mut self) -> Option<&mut OfPieChart> {
232        self.of_pie_chart.as_mut()
233    }
234
235    pub fn set_of_pie_chart(&mut self, value: OfPieChart) -> &mut Self {
236        self.of_pie_chart = Some(value);
237        self
238    }
239
240    pub fn get_category_axis(&self) -> &[CategoryAxis] {
241        &self.category_axis
242    }
243
244    pub fn get_category_axis_mut(&mut self) -> &mut ThinVec<CategoryAxis> {
245        &mut self.category_axis
246    }
247
248    pub fn set_category_axis(&mut self, value: impl Into<ThinVec<CategoryAxis>>) -> &mut Self {
249        self.category_axis = value.into();
250        self
251    }
252
253    pub fn add_category_axis(&mut self, value: CategoryAxis) -> &mut Self {
254        self.category_axis.push(value);
255        self
256    }
257
258    pub fn get_date_axis(&self) -> &[DateAxis] {
259        &self.date_axis
260    }
261
262    pub fn get_date_axis_mut(&mut self) -> &mut ThinVec<DateAxis> {
263        &mut self.date_axis
264    }
265
266    pub fn set_date_axis(&mut self, value: impl Into<ThinVec<DateAxis>>) -> &mut Self {
267        self.date_axis = value.into();
268        self
269    }
270
271    pub fn add_date_axis(&mut self, value: DateAxis) -> &mut Self {
272        self.date_axis.push(value);
273        self
274    }
275
276    pub fn get_value_axis(&self) -> &[ValueAxis] {
277        &self.value_axis
278    }
279
280    pub fn get_value_axis_mut(&mut self) -> &mut ThinVec<ValueAxis> {
281        &mut self.value_axis
282    }
283
284    pub fn set_value_axis(&mut self, value: impl Into<ThinVec<ValueAxis>>) -> &mut Self {
285        self.value_axis = value.into();
286        self
287    }
288
289    pub fn add_value_axis(&mut self, value: ValueAxis) -> &mut Self {
290        self.value_axis.push(value);
291        self
292    }
293
294    pub fn get_series_axis(&self) -> &[SeriesAxis] {
295        &self.series_axis
296    }
297
298    pub fn get_series_axis_mut(&mut self) -> &mut ThinVec<SeriesAxis> {
299        &mut self.series_axis
300    }
301
302    pub fn set_series_axis(&mut self, value: impl Into<ThinVec<SeriesAxis>>) -> &mut Self {
303        self.series_axis = value.into();
304        self
305    }
306
307    pub fn add_series_axis(&mut self, value: SeriesAxis) -> &mut Self {
308        self.series_axis.push(value);
309        self
310    }
311
312    pub fn get_shape_properties(&self) -> Option<&ShapeProperties> {
313        self.shape_properties.as_ref()
314    }
315
316    pub fn get_shape_properties_mut(&mut self) -> Option<&mut ShapeProperties> {
317        self.shape_properties.as_mut()
318    }
319
320    pub fn set_shape_properties(&mut self, value: ShapeProperties) -> &mut Self {
321        self.shape_properties = Some(value);
322        self
323    }
324
325    pub fn set_grouping(&mut self, value: GroupingValues) -> &mut Self {
326        if let Some(chart) = &mut self.line_chart {
327            chart.get_grouping_mut().set_val(value);
328            return self;
329        }
330        if let Some(chart) = &mut self.line_3d_chart {
331            chart.get_grouping_mut().set_val(value);
332            return self;
333        }
334        if let Some(chart) = &mut self.bar_chart {
335            chart.get_grouping_mut().set_val(value);
336            return self;
337        }
338        if let Some(chart) = &mut self.bar_3d_chart {
339            chart.get_grouping_mut().set_val(value);
340            return self;
341        }
342        if let Some(chart) = &mut self.area_chart {
343            chart.get_grouping_mut().set_val(value);
344            return self;
345        }
346        if let Some(chart) = &mut self.area_3d_chart {
347            chart.get_grouping_mut().set_val(value);
348            return self;
349        }
350        panic! {"Non-Grouping."};
351    }
352
353    pub fn get_area_chart_series_list_mut(&mut self) -> &mut AreaChartSeriesList {
354        if let Some(chart) = &mut self.line_chart {
355            return chart.get_area_chart_series_list_mut();
356        }
357        if let Some(chart) = &mut self.line_3d_chart {
358            return chart.get_area_chart_series_list_mut();
359        }
360        if let Some(chart) = &mut self.pie_chart {
361            return chart.get_area_chart_series_list_mut();
362        }
363        if let Some(chart) = &mut self.pie_3d_chart {
364            return chart.get_area_chart_series_list_mut();
365        }
366        if let Some(chart) = &mut self.doughnut_chart {
367            return chart.get_area_chart_series_list_mut();
368        }
369        if let Some(chart) = &mut self.scatter_chart {
370            return chart.get_area_chart_series_list_mut();
371        }
372        if let Some(chart) = &mut self.bar_chart {
373            return chart.get_area_chart_series_list_mut();
374        }
375        if let Some(chart) = &mut self.bar_3d_chart {
376            return chart.get_area_chart_series_list_mut();
377        }
378        if let Some(chart) = &mut self.radar_chart {
379            return chart.get_area_chart_series_list_mut();
380        }
381        if let Some(chart) = &mut self.bubble_chart {
382            return chart.get_area_chart_series_list_mut();
383        }
384        if let Some(chart) = &mut self.area_chart {
385            return chart.get_area_chart_series_list_mut();
386        }
387        if let Some(chart) = &mut self.area_3d_chart {
388            return chart.get_area_chart_series_list_mut();
389        }
390        if let Some(chart) = &mut self.of_pie_chart {
391            return chart.get_area_chart_series_list_mut();
392        }
393        panic! {"Non-ChartSeriesList."};
394    }
395
396    pub fn get_formula_mut(&mut self) -> Vec<&mut Formula> {
397        let mut result: Vec<&mut Formula> = Vec::default();
398        if let Some(v) = &mut self.line_chart {
399            for ser in v
400                .get_area_chart_series_list_mut()
401                .get_area_chart_series_mut()
402            {
403                for formula in ser.get_formula_mut() {
404                    result.push(formula);
405                }
406            }
407        }
408        if let Some(v) = &mut self.line_3d_chart {
409            for ser in v
410                .get_area_chart_series_list_mut()
411                .get_area_chart_series_mut()
412            {
413                for formula in ser.get_formula_mut() {
414                    result.push(formula);
415                }
416            }
417        }
418        if let Some(v) = &mut self.pie_chart {
419            for ser in v
420                .get_area_chart_series_list_mut()
421                .get_area_chart_series_mut()
422            {
423                for formula in ser.get_formula_mut() {
424                    result.push(formula);
425                }
426            }
427        }
428        if let Some(v) = &mut self.pie_3d_chart {
429            for ser in v
430                .get_area_chart_series_list_mut()
431                .get_area_chart_series_mut()
432            {
433                for formula in ser.get_formula_mut() {
434                    result.push(formula);
435                }
436            }
437        }
438        if let Some(v) = &mut self.doughnut_chart {
439            for ser in v
440                .get_area_chart_series_list_mut()
441                .get_area_chart_series_mut()
442            {
443                for formula in ser.get_formula_mut() {
444                    result.push(formula);
445                }
446            }
447        }
448        if let Some(v) = &mut self.scatter_chart {
449            for ser in v
450                .get_area_chart_series_list_mut()
451                .get_area_chart_series_mut()
452            {
453                for formula in ser.get_formula_mut() {
454                    result.push(formula);
455                }
456            }
457        }
458        if let Some(v) = &mut self.bar_chart {
459            for ser in v
460                .get_area_chart_series_list_mut()
461                .get_area_chart_series_mut()
462            {
463                for formula in ser.get_formula_mut() {
464                    result.push(formula);
465                }
466            }
467        }
468        if let Some(v) = &mut self.bar_3d_chart {
469            for ser in v
470                .get_area_chart_series_list_mut()
471                .get_area_chart_series_mut()
472            {
473                for formula in ser.get_formula_mut() {
474                    result.push(formula);
475                }
476            }
477        }
478        if let Some(v) = &mut self.radar_chart {
479            for ser in v
480                .get_area_chart_series_list_mut()
481                .get_area_chart_series_mut()
482            {
483                for formula in ser.get_formula_mut() {
484                    result.push(formula);
485                }
486            }
487        }
488        if let Some(v) = &mut self.bubble_chart {
489            for ser in v
490                .get_area_chart_series_list_mut()
491                .get_area_chart_series_mut()
492            {
493                for formula in ser.get_formula_mut() {
494                    result.push(formula);
495                }
496            }
497        }
498        if let Some(v) = &mut self.area_chart {
499            for ser in v
500                .get_area_chart_series_list_mut()
501                .get_area_chart_series_mut()
502            {
503                for formula in ser.get_formula_mut() {
504                    result.push(formula);
505                }
506            }
507        }
508        if let Some(v) = &mut self.area_3d_chart {
509            for ser in v
510                .get_area_chart_series_list_mut()
511                .get_area_chart_series_mut()
512            {
513                for formula in ser.get_formula_mut() {
514                    result.push(formula);
515                }
516            }
517        }
518        if let Some(v) = &mut self.of_pie_chart {
519            for ser in v
520                .get_area_chart_series_list_mut()
521                .get_area_chart_series_mut()
522            {
523                for formula in ser.get_formula_mut() {
524                    result.push(formula);
525                }
526            }
527        }
528        result
529    }
530
531    pub(crate) fn is_support(&self) -> bool {
532        self.line_chart.is_some()
533            || self.line_3d_chart.is_some()
534            || self.pie_chart.is_some()
535            || self.pie_3d_chart.is_some()
536            || self.doughnut_chart.is_some()
537            || self.scatter_chart.is_some()
538            || self.bar_chart.is_some()
539            || self.bar_3d_chart.is_some()
540            || self.radar_chart.is_some()
541            || self.bubble_chart.is_some()
542            || self.area_chart.is_some()
543            || self.area_3d_chart.is_some()
544            || self.of_pie_chart.is_some()
545    }
546
547    pub(crate) fn set_attributes<R: std::io::BufRead>(
548        &mut self,
549        reader: &mut Reader<R>,
550        _e: &BytesStart,
551    ) {
552        xml_read_loop!(
553            reader,
554            Event::Start(ref e) => match e.name().0 {
555                b"c:layout" => {
556                    self.layout.set_attributes(reader, e, false);
557                }
558                b"c:lineChart" => {
559                    let mut obj = LineChart::default();
560                    obj.set_attributes(reader, e);
561                    self.set_line_chart(obj);
562                }
563                b"c:line3DChart" => {
564                    let mut obj = Line3DChart::default();
565                    obj.set_attributes(reader, e);
566                    self.set_line_3d_chart(obj);
567                }
568                b"c:pieChart" => {
569                    let mut obj = PieChart::default();
570                    obj.set_attributes(reader, e);
571                    self.set_pie_chart(obj);
572                }
573                b"c:pie3DChart" => {
574                    let mut obj = Pie3DChart::default();
575                    obj.set_attributes(reader, e);
576                    self.set_pie_3d_chart(obj);
577                }
578                b"c:doughnutChart" => {
579                    let mut obj = DoughnutChart::default();
580                    obj.set_attributes(reader, e);
581                    self.set_doughnut_chart(obj);
582                }
583                b"c:scatterChart" => {
584                    let mut obj = ScatterChart::default();
585                    obj.set_attributes(reader, e);
586                    self.set_scatter_chart(obj);
587                }
588                b"c:barChart" => {
589                    let mut obj = BarChart::default();
590                    obj.set_attributes(reader, e);
591                    self.set_bar_chart(obj);
592                }
593                b"c:bar3DChart" => {
594                    let mut obj = Bar3DChart::default();
595                    obj.set_attributes(reader, e);
596                    self.set_bar_3d_chart(obj);
597                }
598                b"c:radarChart" => {
599                    let mut obj = RadarChart::default();
600                    obj.set_attributes(reader, e);
601                    self.set_radar_chart(obj);
602                }
603                b"c:bubbleChart" => {
604                    let mut obj = BubbleChart::default();
605                    obj.set_attributes(reader, e);
606                    self.set_bubble_chart(obj);
607                }
608                b"c:areaChart" => {
609                    let mut obj = AreaChart::default();
610                    obj.set_attributes(reader, e);
611                    self.set_area_chart(obj);
612                }
613                b"c:area3DChart" => {
614                    let mut obj = Area3DChart::default();
615                    obj.set_attributes(reader, e);
616                    self.set_area_3d_chart(obj);
617                }
618                b"c:ofPieChart" => {
619                    let mut obj = OfPieChart::default();
620                    obj.set_attributes(reader, e);
621                    self.set_of_pie_chart(obj);
622                }
623                b"c:catAx" => {
624                    let mut obj = CategoryAxis::default();
625                    obj.set_attributes(reader, e);
626                    self.add_category_axis(obj);
627                }
628                b"c:dateAx" => {
629                    let mut obj = DateAxis::default();
630                    obj.set_attributes(reader, e);
631                    self.add_date_axis(obj);
632                }
633                b"c:valAx" => {
634                    let mut obj = ValueAxis::default();
635                    obj.set_attributes(reader, e);
636                    self.add_value_axis(obj);
637                }
638                b"c:serAx" => {
639                    let mut obj = SeriesAxis::default();
640                    obj.set_attributes(reader, e);
641                    self.add_series_axis(obj);
642                }
643                b"c:spPr" => {
644                    let mut obj = ShapeProperties::default();
645                    obj.set_attributes(reader, e);
646                    self.set_shape_properties(obj);
647                }
648                _ => (),
649            },
650            Event::End(ref e) => {
651                if e.name().0 == b"c:plotArea" {
652                    return;
653                }
654            },
655            Event::Eof => panic!("Error: Could not find {} end element", "c:plotArea"),
656        );
657    }
658
659    pub(crate) fn write_to(&self, writer: &mut Writer<Cursor<Vec<u8>>>, spreadsheet: &Spreadsheet) {
660        // c:plotArea
661        write_start_tag(writer, "c:plotArea", vec![], false);
662
663        // c:layout
664        self.layout.write_to(writer);
665
666        // c:lineChart
667        if let Some(v) = &self.line_chart {
668            v.write_to(writer, spreadsheet);
669        }
670
671        // c:line3DChart
672        if let Some(v) = &self.line_3d_chart {
673            v.write_to(writer, spreadsheet);
674        }
675
676        // c:pieChart
677        if let Some(v) = &self.pie_chart {
678            v.write_to(writer, spreadsheet);
679        }
680
681        // c:pie3DChart
682        if let Some(v) = &self.pie_3d_chart {
683            v.write_to(writer, spreadsheet);
684        }
685
686        // c:doughnutChart
687        if let Some(v) = &self.doughnut_chart {
688            v.write_to(writer, spreadsheet);
689        }
690
691        // c:scatterChart
692        if let Some(v) = &self.scatter_chart {
693            v.write_to(writer, spreadsheet);
694        }
695
696        // c:barChart
697        if let Some(v) = &self.bar_chart {
698            v.write_to(writer, spreadsheet);
699        }
700
701        // c:bar3DChart
702        if let Some(v) = &self.bar_3d_chart {
703            v.write_to(writer, spreadsheet);
704        }
705
706        // c:radarChart
707        if let Some(v) = &self.radar_chart {
708            v.write_to(writer, spreadsheet);
709        }
710
711        // c:bubbleChart
712        if let Some(v) = &self.bubble_chart {
713            v.write_to(writer, spreadsheet);
714        }
715
716        // c:areaChart
717        if let Some(v) = &self.area_chart {
718            v.write_to(writer, spreadsheet);
719        }
720
721        // c:area3DChart
722        if let Some(v) = &self.area_3d_chart {
723            v.write_to(writer, spreadsheet);
724        }
725
726        // c:ofPieChart
727        if let Some(v) = &self.of_pie_chart {
728            v.write_to(writer, spreadsheet);
729        }
730
731        // c:catAx
732        for v in &self.category_axis {
733            v.write_to(writer, spreadsheet);
734        }
735
736        // c:dateAx
737        for v in &self.date_axis {
738            v.write_to(writer, spreadsheet);
739        }
740
741        // c:valAx
742        for v in &self.value_axis {
743            v.write_to(writer, spreadsheet);
744        }
745
746        // c:serAx
747        for v in &self.series_axis {
748            v.write_to(writer, spreadsheet);
749        }
750
751        // c:spPr
752        if let Some(v) = &self.shape_properties {
753            v.write_to(writer);
754        }
755
756        write_end_tag(writer, "c:plotArea");
757    }
758}
759impl AdjustmentCoordinateWithSheet for PlotArea {
760    fn adjustment_insert_coordinate_with_sheet(
761        &mut self,
762        sheet_name: &str,
763        root_col_num: &u32,
764        offset_col_num: &u32,
765        root_row_num: &u32,
766        offset_row_num: &u32,
767    ) {
768        for formula in self.get_formula_mut() {
769            formula.adjustment_insert_coordinate_with_sheet(
770                sheet_name,
771                root_col_num,
772                offset_col_num,
773                root_row_num,
774                offset_row_num,
775            );
776        }
777    }
778
779    fn adjustment_remove_coordinate_with_sheet(
780        &mut self,
781        sheet_name: &str,
782        root_col_num: &u32,
783        offset_col_num: &u32,
784        root_row_num: &u32,
785        offset_row_num: &u32,
786    ) {
787        for formula in self.get_formula_mut() {
788            formula.adjustment_remove_coordinate_with_sheet(
789                sheet_name,
790                root_col_num,
791                offset_col_num,
792                root_row_num,
793                offset_row_num,
794            );
795        }
796    }
797}