npoi
753 строки · 20.8 Кб
1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Text;
5using System.Xml;
6using System.Xml.Serialization;
7
8
9namespace NPOI.OpenXmlFormats.Dml.Chart
10{
11
12[Serializable]
13
14[System.ComponentModel.DesignerCategoryAttribute("code")]
15[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
16[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
17public class CT_Area3DChart
18{
19
20private CT_Grouping groupingField;
21
22private CT_Boolean varyColorsField;
23
24private List<CT_AreaSer> serField;
25
26private CT_DLbls dLblsField;
27
28private CT_ChartLines dropLinesField;
29
30private CT_GapAmount gapDepthField;
31
32private List<CT_UnsignedInt> axIdField;
33
34private List<CT_Extension> extLstField;
35
36public CT_Area3DChart()
37{
38}
39public static CT_Area3DChart Parse(XmlNode node, XmlNamespaceManager namespaceManager)
40{
41if (node == null)
42return null;
43CT_Area3DChart ctObj = new CT_Area3DChart();
44ctObj.ser = new List<CT_AreaSer>();
45ctObj.axId = new List<CT_UnsignedInt>();
46ctObj.extLst = new List<CT_Extension>();
47foreach (XmlNode childNode in node.ChildNodes)
48{
49if (childNode.LocalName == "grouping")
50ctObj.grouping = CT_Grouping.Parse(childNode, namespaceManager);
51else if (childNode.LocalName == "varyColors")
52ctObj.varyColors = CT_Boolean.Parse(childNode, namespaceManager);
53else if (childNode.LocalName == "dLbls")
54ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
55else if (childNode.LocalName == "dropLines")
56ctObj.dropLines = CT_ChartLines.Parse(childNode, namespaceManager);
57else if (childNode.LocalName == "gapDepth")
58ctObj.gapDepth = CT_GapAmount.Parse(childNode, namespaceManager);
59else if (childNode.LocalName == "ser")
60ctObj.ser.Add(CT_AreaSer.Parse(childNode, namespaceManager));
61else if (childNode.LocalName == "axId")
62ctObj.axId.Add(CT_UnsignedInt.Parse(childNode, namespaceManager));
63else if (childNode.LocalName == "extLst")
64ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
65}
66return ctObj;
67}
68
69
70
71internal void Write(StreamWriter sw, string nodeName)
72{
73sw.Write(string.Format("<c:{0}", nodeName));
74sw.Write(">");
75if (this.grouping != null)
76this.grouping.Write(sw, "grouping");
77if (this.varyColors != null)
78this.varyColors.Write(sw, "varyColors");
79if (this.dLbls != null)
80this.dLbls.Write(sw, "dLbls");
81if (this.dropLines != null)
82this.dropLines.Write(sw, "dropLines");
83if (this.gapDepth != null)
84this.gapDepth.Write(sw, "gapDepth");
85if (this.ser != null)
86{
87foreach (CT_AreaSer x in this.ser)
88{
89x.Write(sw, "ser");
90}
91}
92if (this.axId != null)
93{
94foreach (CT_UnsignedInt x in this.axId)
95{
96x.Write(sw, "axId");
97}
98}
99if (this.extLst != null)
100{
101foreach (CT_Extension x in this.extLst)
102{
103x.Write(sw, "extLst");
104}
105}
106sw.Write(string.Format("</c:{0}>", nodeName));
107}
108
109public int GetSeriesCount()
110{
111return this.serField == null ? 0 : this.serField.Count;
112}
113
114[XmlElement(Order = 0)]
115public CT_Grouping grouping
116{
117get
118{
119return this.groupingField;
120}
121set
122{
123this.groupingField = value;
124}
125}
126
127[XmlElement(Order = 1)]
128public CT_Boolean varyColors
129{
130get
131{
132return this.varyColorsField;
133}
134set
135{
136this.varyColorsField = value;
137}
138}
139
140[XmlElement("ser", Order = 2)]
141public List<CT_AreaSer> ser
142{
143get
144{
145return this.serField;
146}
147set
148{
149this.serField = value;
150}
151}
152
153[XmlElement(Order = 3)]
154public CT_DLbls dLbls
155{
156get
157{
158return this.dLblsField;
159}
160set
161{
162this.dLblsField = value;
163}
164}
165
166[XmlElement(Order = 4)]
167public CT_ChartLines dropLines
168{
169get
170{
171return this.dropLinesField;
172}
173set
174{
175this.dropLinesField = value;
176}
177}
178
179[XmlElement(Order = 5)]
180public CT_GapAmount gapDepth
181{
182get
183{
184return this.gapDepthField;
185}
186set
187{
188this.gapDepthField = value;
189}
190}
191
192[XmlElement("axId", Order = 6)]
193public List<CT_UnsignedInt> axId
194{
195get
196{
197return this.axIdField;
198}
199set
200{
201this.axIdField = value;
202}
203}
204
205[XmlElement(Order = 7)]
206public List<CT_Extension> extLst
207{
208get
209{
210return this.extLstField;
211}
212set
213{
214this.extLstField = value;
215}
216}
217}
218
219
220[Serializable]
221
222[System.ComponentModel.DesignerCategoryAttribute("code")]
223[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
224[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
225public class CT_AreaSer
226{
227
228private CT_UnsignedInt idxField;
229
230private CT_UnsignedInt orderField;
231
232private CT_SerTx txField;
233
234private CT_ShapeProperties spPrField;
235
236private CT_PictureOptions pictureOptionsField;
237
238private List<CT_DPt> dPtField;
239
240private CT_DLbls dLblsField;
241
242private List<CT_Trendline> trendlineField;
243
244private List<CT_ErrBars> errBarsField;
245
246private CT_AxDataSource catField;
247
248private CT_NumDataSource valField;
249
250private List<CT_Extension> extLstField;
251public static CT_AreaSer Parse(XmlNode node, XmlNamespaceManager namespaceManager)
252{
253if (node == null)
254return null;
255CT_AreaSer ctObj = new CT_AreaSer();
256ctObj.dPt = new List<CT_DPt>();
257ctObj.trendline = new List<CT_Trendline>();
258ctObj.errBars = new List<CT_ErrBars>();
259ctObj.extLst = new List<CT_Extension>();
260foreach (XmlNode childNode in node.ChildNodes)
261{
262if (childNode.LocalName == "idx")
263ctObj.idx = CT_UnsignedInt.Parse(childNode, namespaceManager);
264else if (childNode.LocalName == "order")
265ctObj.order = CT_UnsignedInt.Parse(childNode, namespaceManager);
266else if (childNode.LocalName == "tx")
267ctObj.tx = CT_SerTx.Parse(childNode, namespaceManager);
268else if (childNode.LocalName == "spPr")
269ctObj.spPr = CT_ShapeProperties.Parse(childNode, namespaceManager);
270else if (childNode.LocalName == "pictureOptions")
271ctObj.pictureOptions = CT_PictureOptions.Parse(childNode, namespaceManager);
272else if (childNode.LocalName == "dLbls")
273ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
274else if (childNode.LocalName == "cat")
275ctObj.cat = CT_AxDataSource.Parse(childNode, namespaceManager);
276else if (childNode.LocalName == "val")
277ctObj.val = CT_NumDataSource.Parse(childNode, namespaceManager);
278else if (childNode.LocalName == "dPt")
279ctObj.dPt.Add(CT_DPt.Parse(childNode, namespaceManager));
280else if (childNode.LocalName == "trendline")
281ctObj.trendline.Add(CT_Trendline.Parse(childNode, namespaceManager));
282else if (childNode.LocalName == "errBars")
283ctObj.errBars.Add(CT_ErrBars.Parse(childNode, namespaceManager));
284else if (childNode.LocalName == "extLst")
285ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
286}
287return ctObj;
288}
289
290
291
292internal void Write(StreamWriter sw, string nodeName)
293{
294sw.Write(string.Format("<c:{0}", nodeName));
295sw.Write(">");
296if (this.idx != null)
297this.idx.Write(sw, "idx");
298if (this.order != null)
299this.order.Write(sw, "order");
300if (this.tx != null)
301this.tx.Write(sw, "tx");
302if (this.spPr != null)
303this.spPr.Write(sw, "spPr");
304if (this.pictureOptions != null)
305this.pictureOptions.Write(sw, "pictureOptions");
306if (this.dLbls != null)
307this.dLbls.Write(sw, "dLbls");
308if (this.cat != null)
309this.cat.Write(sw, "cat");
310if (this.val != null)
311this.val.Write(sw, "val");
312if (this.dPt != null)
313{
314foreach (CT_DPt x in this.dPt)
315{
316x.Write(sw, "dPt");
317}
318}
319if (this.trendline != null)
320{
321foreach (CT_Trendline x in this.trendline)
322{
323x.Write(sw, "trendline");
324}
325}
326if (this.errBars != null)
327{
328foreach (CT_ErrBars x in this.errBars)
329{
330x.Write(sw, "errBars");
331}
332}
333if (this.extLst != null)
334{
335foreach (CT_Extension x in this.extLst)
336{
337x.Write(sw, "extLst");
338}
339}
340sw.Write(string.Format("</c:{0}>", nodeName));
341}
342
343public CT_AreaSer()
344{
345//this.extLstField = new List<CT_Extension>();
346//this.valField = new CT_NumDataSource();
347//this.catField = new CT_AxDataSource();
348//this.errBarsField = new List<CT_ErrBars>();
349//this.trendlineField = new List<CT_Trendline>();
350//this.dLblsField = new CT_DLbls();
351//this.dPtField = new List<CT_DPt>();
352//this.pictureOptionsField = new CT_PictureOptions();
353//this.txField = new CT_SerTx();
354//this.orderField = new CT_UnsignedInt();
355//this.idxField = new CT_UnsignedInt();
356}
357
358[XmlElement(Order = 0)]
359public CT_UnsignedInt idx
360{
361get
362{
363return this.idxField;
364}
365set
366{
367this.idxField = value;
368}
369}
370
371[XmlElement(Order = 1)]
372public CT_UnsignedInt order
373{
374get
375{
376return this.orderField;
377}
378set
379{
380this.orderField = value;
381}
382}
383
384[XmlElement(Order = 2)]
385public CT_SerTx tx
386{
387get
388{
389return this.txField;
390}
391set
392{
393this.txField = value;
394}
395}
396
397[XmlElement(Order = 3)]
398public CT_ShapeProperties spPr
399{
400get
401{
402return this.spPrField;
403}
404set
405{
406this.spPrField = value;
407}
408}
409
410[XmlElement(Order = 4)]
411public CT_PictureOptions pictureOptions
412{
413get
414{
415return this.pictureOptionsField;
416}
417set
418{
419this.pictureOptionsField = value;
420}
421}
422
423[XmlElement("dPt", Order = 5)]
424public List<CT_DPt> dPt
425{
426get
427{
428return this.dPtField;
429}
430set
431{
432this.dPtField = value;
433}
434}
435
436[XmlElement(Order = 6)]
437public CT_DLbls dLbls
438{
439get
440{
441return this.dLblsField;
442}
443set
444{
445this.dLblsField = value;
446}
447}
448
449[XmlElement("trendline", Order = 7)]
450public List<CT_Trendline> trendline
451{
452get
453{
454return this.trendlineField;
455}
456set
457{
458this.trendlineField = value;
459}
460}
461
462[XmlElement("errBars", Order = 8)]
463public List<CT_ErrBars> errBars
464{
465get
466{
467return this.errBarsField;
468}
469set
470{
471this.errBarsField = value;
472}
473}
474
475[XmlElement(Order = 9)]
476public CT_AxDataSource cat
477{
478get
479{
480return this.catField;
481}
482set
483{
484this.catField = value;
485}
486}
487
488[XmlElement(Order = 10)]
489public CT_NumDataSource val
490{
491get
492{
493return this.valField;
494}
495set
496{
497this.valField = value;
498}
499}
500
501[XmlElement(Order = 11)]
502public List<CT_Extension> extLst
503{
504get
505{
506return this.extLstField;
507}
508set
509{
510this.extLstField = value;
511}
512}
513
514public CT_UnsignedInt AddNewIdx()
515{
516this.idxField = new CT_UnsignedInt();
517return this.idxField;
518}
519
520public CT_UnsignedInt AddNewOrder()
521{
522this.orderField = new CT_UnsignedInt();
523return this.orderField;
524}
525
526public CT_AxDataSource AddNewCat()
527{
528this.catField = new CT_AxDataSource();
529return this.catField;
530}
531
532public CT_NumDataSource AddNewVal()
533{
534this.valField = new CT_NumDataSource();
535return this.valField;
536}
537}
538
539[Serializable]
540
541[System.ComponentModel.DesignerCategoryAttribute("code")]
542[XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
543[XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
544public class CT_AreaChart
545{
546
547private CT_Grouping groupingField;
548
549private CT_Boolean varyColorsField;
550
551private List<CT_AreaSer> serField;
552
553private CT_DLbls dLblsField;
554
555private CT_ChartLines dropLinesField;
556
557private List<CT_UnsignedInt> axIdField;
558
559private List<CT_Extension> extLstField;
560
561public CT_AreaChart()
562{
563
564}
565public static CT_AreaChart Parse(XmlNode node, XmlNamespaceManager namespaceManager)
566{
567if (node == null)
568return null;
569CT_AreaChart ctObj = new CT_AreaChart();
570ctObj.ser = new List<CT_AreaSer>();
571ctObj.axId = new List<CT_UnsignedInt>();
572ctObj.extLst = new List<CT_Extension>();
573foreach (XmlNode childNode in node.ChildNodes)
574{
575if (childNode.LocalName == "grouping")
576ctObj.grouping = CT_Grouping.Parse(childNode, namespaceManager);
577else if (childNode.LocalName == "varyColors")
578ctObj.varyColors = CT_Boolean.Parse(childNode, namespaceManager);
579else if (childNode.LocalName == "dLbls")
580ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
581else if (childNode.LocalName == "dropLines")
582ctObj.dropLines = CT_ChartLines.Parse(childNode, namespaceManager);
583else if (childNode.LocalName == "ser")
584ctObj.ser.Add(CT_AreaSer.Parse(childNode, namespaceManager));
585else if (childNode.LocalName == "axId")
586ctObj.axId.Add(CT_UnsignedInt.Parse(childNode, namespaceManager));
587else if (childNode.LocalName == "extLst")
588ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
589}
590return ctObj;
591}
592
593
594
595internal void Write(StreamWriter sw, string nodeName)
596{
597sw.Write(string.Format("<c:{0}", nodeName));
598sw.Write(">");
599if (this.grouping != null)
600this.grouping.Write(sw, "grouping");
601if (this.varyColors != null)
602this.varyColors.Write(sw, "varyColors");
603if (this.dropLines != null)
604this.dropLines.Write(sw, "dropLines");
605if (this.ser != null)
606{
607foreach (CT_AreaSer x in this.ser)
608{
609x.Write(sw, "ser");
610}
611}
612if (this.dLbls != null)
613this.dLbls.Write(sw, "dLbls");
614if (this.axId != null)
615{
616foreach (CT_UnsignedInt x in this.axId)
617{
618x.Write(sw, "axId");
619}
620}
621if (this.extLst != null)
622{
623foreach (CT_Extension x in this.extLst)
624{
625x.Write(sw, "extLst");
626}
627}
628sw.Write(string.Format("</c:{0}>", nodeName));
629}
630
631public int GetSeriesCount()
632{
633return this.serField == null ? 0 : this.serField.Count;
634}
635
636[XmlElement(Order = 0)]
637public CT_Grouping grouping
638{
639get
640{
641return this.groupingField;
642}
643set
644{
645this.groupingField = value;
646}
647}
648
649[XmlElement(Order = 1)]
650public CT_Boolean varyColors
651{
652get
653{
654return this.varyColorsField;
655}
656set
657{
658this.varyColorsField = value;
659}
660}
661
662[XmlElement("ser", Order = 2)]
663public List<CT_AreaSer> ser
664{
665get
666{
667return this.serField;
668}
669set
670{
671this.serField = value;
672}
673}
674
675[XmlElement(Order = 3)]
676public CT_DLbls dLbls
677{
678get
679{
680return this.dLblsField;
681}
682set
683{
684this.dLblsField = value;
685}
686}
687
688[XmlElement(Order = 4)]
689public CT_ChartLines dropLines
690{
691get
692{
693return this.dropLinesField;
694}
695set
696{
697this.dropLinesField = value;
698}
699}
700
701[XmlElement("axId", Order = 5)]
702public List<CT_UnsignedInt> axId
703{
704get
705{
706return this.axIdField;
707}
708set
709{
710this.axIdField = value;
711}
712}
713
714[XmlElement(Order = 6)]
715public List<CT_Extension> extLst
716{
717get
718{
719return this.extLstField;
720}
721set
722{
723this.extLstField = value;
724}
725}
726
727public CT_Boolean AddNewVaryColors()
728{
729this.varyColorsField = new CT_Boolean();
730return this.varyColorsField;
731}
732
733public CT_UnsignedInt AddNewAxId()
734{
735CT_UnsignedInt si = new CT_UnsignedInt();
736if (this.axIdField == null)
737this.axIdField = new List<CT_UnsignedInt>();
738axIdField.Add(si);
739return si;
740}
741
742public CT_AreaSer AddNewSer()
743{
744CT_AreaSer newSer = new CT_AreaSer();
745if (this.serField == null)
746{
747this.serField = new List<CT_AreaSer>();
748}
749this.serField.Add(newSer);
750return newSer;
751}
752}
753}
754