npoi

Форк
0
753 строки · 20.8 Кб
1
using System;
2
using System.Collections.Generic;
3
using System.IO;
4
using System.Text;
5
using System.Xml;
6
using System.Xml.Serialization;
7

8

9
namespace 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)]
17
    public class CT_Area3DChart
18
    {
19

20
        private CT_Grouping groupingField;
21

22
        private CT_Boolean varyColorsField;
23

24
        private List<CT_AreaSer> serField;
25

26
        private CT_DLbls dLblsField;
27

28
        private CT_ChartLines dropLinesField;
29

30
        private CT_GapAmount gapDepthField;
31

32
        private List<CT_UnsignedInt> axIdField;
33

34
        private List<CT_Extension> extLstField;
35

36
        public CT_Area3DChart()
37
        {
38
        }
39
        public static CT_Area3DChart Parse(XmlNode node, XmlNamespaceManager namespaceManager)
40
        {
41
            if (node == null)
42
                return null;
43
            CT_Area3DChart ctObj = new CT_Area3DChart();
44
            ctObj.ser = new List<CT_AreaSer>();
45
            ctObj.axId = new List<CT_UnsignedInt>();
46
            ctObj.extLst = new List<CT_Extension>();
47
            foreach (XmlNode childNode in node.ChildNodes)
48
            {
49
                if (childNode.LocalName == "grouping")
50
                    ctObj.grouping = CT_Grouping.Parse(childNode, namespaceManager);
51
                else if (childNode.LocalName == "varyColors")
52
                    ctObj.varyColors = CT_Boolean.Parse(childNode, namespaceManager);
53
                else if (childNode.LocalName == "dLbls")
54
                    ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
55
                else if (childNode.LocalName == "dropLines")
56
                    ctObj.dropLines = CT_ChartLines.Parse(childNode, namespaceManager);
57
                else if (childNode.LocalName == "gapDepth")
58
                    ctObj.gapDepth = CT_GapAmount.Parse(childNode, namespaceManager);
59
                else if (childNode.LocalName == "ser")
60
                    ctObj.ser.Add(CT_AreaSer.Parse(childNode, namespaceManager));
61
                else if (childNode.LocalName == "axId")
62
                    ctObj.axId.Add(CT_UnsignedInt.Parse(childNode, namespaceManager));
63
                else if (childNode.LocalName == "extLst")
64
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
65
            }
66
            return ctObj;
67
        }
68

69

70

71
        internal void Write(StreamWriter sw, string nodeName)
72
        {
73
            sw.Write(string.Format("<c:{0}", nodeName));
74
            sw.Write(">");
75
            if (this.grouping != null)
76
                this.grouping.Write(sw, "grouping");
77
            if (this.varyColors != null)
78
                this.varyColors.Write(sw, "varyColors");
79
            if (this.dLbls != null)
80
                this.dLbls.Write(sw, "dLbls");
81
            if (this.dropLines != null)
82
                this.dropLines.Write(sw, "dropLines");
83
            if (this.gapDepth != null)
84
                this.gapDepth.Write(sw, "gapDepth");
85
            if (this.ser != null)
86
            {
87
                foreach (CT_AreaSer x in this.ser)
88
                {
89
                    x.Write(sw, "ser");
90
                }
91
            }
92
            if (this.axId != null)
93
            {
94
                foreach (CT_UnsignedInt x in this.axId)
95
                {
96
                    x.Write(sw, "axId");
97
                }
98
            }
99
            if (this.extLst != null)
100
            {
101
                foreach (CT_Extension x in this.extLst)
102
                {
103
                    x.Write(sw, "extLst");
104
                }
105
            }
106
            sw.Write(string.Format("</c:{0}>", nodeName));
107
        }
108

109
        public int GetSeriesCount()
110
        {
111
            return this.serField == null ? 0 : this.serField.Count;
112
        }
113

114
        [XmlElement(Order = 0)]
115
        public CT_Grouping grouping
116
        {
117
            get
118
            {
119
                return this.groupingField;
120
            }
121
            set
122
            {
123
                this.groupingField = value;
124
            }
125
        }
126

127
        [XmlElement(Order = 1)]
128
        public CT_Boolean varyColors
129
        {
130
            get
131
            {
132
                return this.varyColorsField;
133
            }
134
            set
135
            {
136
                this.varyColorsField = value;
137
            }
138
        }
139

140
        [XmlElement("ser", Order = 2)]
141
        public List<CT_AreaSer> ser
142
        {
143
            get
144
            {
145
                return this.serField;
146
            }
147
            set
148
            {
149
                this.serField = value;
150
            }
151
        }
152

153
        [XmlElement(Order = 3)]
154
        public CT_DLbls dLbls
155
        {
156
            get
157
            {
158
                return this.dLblsField;
159
            }
160
            set
161
            {
162
                this.dLblsField = value;
163
            }
164
        }
165

166
        [XmlElement(Order = 4)]
167
        public CT_ChartLines dropLines
168
        {
169
            get
170
            {
171
                return this.dropLinesField;
172
            }
173
            set
174
            {
175
                this.dropLinesField = value;
176
            }
177
        }
178

179
        [XmlElement(Order = 5)]
180
        public CT_GapAmount gapDepth
181
        {
182
            get
183
            {
184
                return this.gapDepthField;
185
            }
186
            set
187
            {
188
                this.gapDepthField = value;
189
            }
190
        }
191

192
        [XmlElement("axId", Order = 6)]
193
        public List<CT_UnsignedInt> axId
194
        {
195
            get
196
            {
197
                return this.axIdField;
198
            }
199
            set
200
            {
201
                this.axIdField = value;
202
            }
203
        }
204

205
        [XmlElement(Order = 7)]
206
        public List<CT_Extension> extLst
207
        {
208
            get
209
            {
210
                return this.extLstField;
211
            }
212
            set
213
            {
214
                this.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)]
225
    public class CT_AreaSer
226
    {
227

228
        private CT_UnsignedInt idxField;
229

230
        private CT_UnsignedInt orderField;
231

232
        private CT_SerTx txField;
233

234
        private CT_ShapeProperties spPrField;
235

236
        private CT_PictureOptions pictureOptionsField;
237

238
        private List<CT_DPt> dPtField;
239

240
        private CT_DLbls dLblsField;
241

242
        private List<CT_Trendline> trendlineField;
243

244
        private List<CT_ErrBars> errBarsField;
245

246
        private CT_AxDataSource catField;
247

248
        private CT_NumDataSource valField;
249

250
        private List<CT_Extension> extLstField;
251
        public static CT_AreaSer Parse(XmlNode node, XmlNamespaceManager namespaceManager)
252
        {
253
            if (node == null)
254
                return null;
255
            CT_AreaSer ctObj = new CT_AreaSer();
256
            ctObj.dPt = new List<CT_DPt>();
257
            ctObj.trendline = new List<CT_Trendline>();
258
            ctObj.errBars = new List<CT_ErrBars>();
259
            ctObj.extLst = new List<CT_Extension>();
260
            foreach (XmlNode childNode in node.ChildNodes)
261
            {
262
                if (childNode.LocalName == "idx")
263
                    ctObj.idx = CT_UnsignedInt.Parse(childNode, namespaceManager);
264
                else if (childNode.LocalName == "order")
265
                    ctObj.order = CT_UnsignedInt.Parse(childNode, namespaceManager);
266
                else if (childNode.LocalName == "tx")
267
                    ctObj.tx = CT_SerTx.Parse(childNode, namespaceManager);
268
                else if (childNode.LocalName == "spPr")
269
                    ctObj.spPr = CT_ShapeProperties.Parse(childNode, namespaceManager);
270
                else if (childNode.LocalName == "pictureOptions")
271
                    ctObj.pictureOptions = CT_PictureOptions.Parse(childNode, namespaceManager);
272
                else if (childNode.LocalName == "dLbls")
273
                    ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
274
                else if (childNode.LocalName == "cat")
275
                    ctObj.cat = CT_AxDataSource.Parse(childNode, namespaceManager);
276
                else if (childNode.LocalName == "val")
277
                    ctObj.val = CT_NumDataSource.Parse(childNode, namespaceManager);
278
                else if (childNode.LocalName == "dPt")
279
                    ctObj.dPt.Add(CT_DPt.Parse(childNode, namespaceManager));
280
                else if (childNode.LocalName == "trendline")
281
                    ctObj.trendline.Add(CT_Trendline.Parse(childNode, namespaceManager));
282
                else if (childNode.LocalName == "errBars")
283
                    ctObj.errBars.Add(CT_ErrBars.Parse(childNode, namespaceManager));
284
                else if (childNode.LocalName == "extLst")
285
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
286
            }
287
            return ctObj;
288
        }
289

290

291

292
        internal void Write(StreamWriter sw, string nodeName)
293
        {
294
            sw.Write(string.Format("<c:{0}", nodeName));
295
            sw.Write(">");
296
            if (this.idx != null)
297
                this.idx.Write(sw, "idx");
298
            if (this.order != null)
299
                this.order.Write(sw, "order");
300
            if (this.tx != null)
301
                this.tx.Write(sw, "tx");
302
            if (this.spPr != null)
303
                this.spPr.Write(sw, "spPr");
304
            if (this.pictureOptions != null)
305
                this.pictureOptions.Write(sw, "pictureOptions");
306
            if (this.dLbls != null)
307
                this.dLbls.Write(sw, "dLbls");
308
            if (this.cat != null)
309
                this.cat.Write(sw, "cat");
310
            if (this.val != null)
311
                this.val.Write(sw, "val");
312
            if (this.dPt != null)
313
            {
314
                foreach (CT_DPt x in this.dPt)
315
                {
316
                    x.Write(sw, "dPt");
317
                }
318
            }
319
            if (this.trendline != null)
320
            {
321
                foreach (CT_Trendline x in this.trendline)
322
                {
323
                    x.Write(sw, "trendline");
324
                }
325
            }
326
            if (this.errBars != null)
327
            {
328
                foreach (CT_ErrBars x in this.errBars)
329
                {
330
                    x.Write(sw, "errBars");
331
                }
332
            }
333
            if (this.extLst != null)
334
            {
335
                foreach (CT_Extension x in this.extLst)
336
                {
337
                    x.Write(sw, "extLst");
338
                }
339
            }
340
            sw.Write(string.Format("</c:{0}>", nodeName));
341
        }
342

343
        public 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)]
359
        public CT_UnsignedInt idx
360
        {
361
            get
362
            {
363
                return this.idxField;
364
            }
365
            set
366
            {
367
                this.idxField = value;
368
            }
369
        }
370

371
        [XmlElement(Order = 1)]
372
        public CT_UnsignedInt order
373
        {
374
            get
375
            {
376
                return this.orderField;
377
            }
378
            set
379
            {
380
                this.orderField = value;
381
            }
382
        }
383

384
        [XmlElement(Order = 2)]
385
        public CT_SerTx tx
386
        {
387
            get
388
            {
389
                return this.txField;
390
            }
391
            set
392
            {
393
                this.txField = value;
394
            }
395
        }
396

397
        [XmlElement(Order = 3)]
398
        public CT_ShapeProperties spPr
399
        {
400
            get
401
            {
402
                return this.spPrField;
403
            }
404
            set
405
            {
406
                this.spPrField = value;
407
            }
408
        }
409

410
        [XmlElement(Order = 4)]
411
        public CT_PictureOptions pictureOptions
412
        {
413
            get
414
            {
415
                return this.pictureOptionsField;
416
            }
417
            set
418
            {
419
                this.pictureOptionsField = value;
420
            }
421
        }
422

423
        [XmlElement("dPt", Order = 5)]
424
        public List<CT_DPt> dPt
425
        {
426
            get
427
            {
428
                return this.dPtField;
429
            }
430
            set
431
            {
432
                this.dPtField = value;
433
            }
434
        }
435

436
        [XmlElement(Order = 6)]
437
        public CT_DLbls dLbls
438
        {
439
            get
440
            {
441
                return this.dLblsField;
442
            }
443
            set
444
            {
445
                this.dLblsField = value;
446
            }
447
        }
448

449
        [XmlElement("trendline", Order = 7)]
450
        public List<CT_Trendline> trendline
451
        {
452
            get
453
            {
454
                return this.trendlineField;
455
            }
456
            set
457
            {
458
                this.trendlineField = value;
459
            }
460
        }
461

462
        [XmlElement("errBars", Order = 8)]
463
        public List<CT_ErrBars> errBars
464
        {
465
            get
466
            {
467
                return this.errBarsField;
468
            }
469
            set
470
            {
471
                this.errBarsField = value;
472
            }
473
        }
474

475
        [XmlElement(Order = 9)]
476
        public CT_AxDataSource cat
477
        {
478
            get
479
            {
480
                return this.catField;
481
            }
482
            set
483
            {
484
                this.catField = value;
485
            }
486
        }
487

488
        [XmlElement(Order = 10)]
489
        public CT_NumDataSource val
490
        {
491
            get
492
            {
493
                return this.valField;
494
            }
495
            set
496
            {
497
                this.valField = value;
498
            }
499
        }
500

501
        [XmlElement(Order = 11)]
502
        public List<CT_Extension> extLst
503
        {
504
            get
505
            {
506
                return this.extLstField;
507
            }
508
            set
509
            {
510
                this.extLstField = value;
511
            }
512
        }
513

514
        public CT_UnsignedInt AddNewIdx()
515
        {
516
            this.idxField = new CT_UnsignedInt();
517
            return this.idxField;
518
        }
519

520
        public CT_UnsignedInt AddNewOrder()
521
        {
522
            this.orderField = new CT_UnsignedInt();
523
            return this.orderField;
524
        }
525

526
        public CT_AxDataSource AddNewCat()
527
        {
528
            this.catField = new CT_AxDataSource();
529
            return this.catField;
530
        }
531

532
        public CT_NumDataSource AddNewVal()
533
        {
534
            this.valField = new CT_NumDataSource();
535
            return 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)]
544
    public class CT_AreaChart
545
    {
546

547
        private CT_Grouping groupingField;
548

549
        private CT_Boolean varyColorsField;
550

551
        private List<CT_AreaSer> serField;
552

553
        private CT_DLbls dLblsField;
554

555
        private CT_ChartLines dropLinesField;
556

557
        private List<CT_UnsignedInt> axIdField;
558

559
        private List<CT_Extension> extLstField;
560

561
        public CT_AreaChart()
562
        {
563

564
        }
565
        public static CT_AreaChart Parse(XmlNode node, XmlNamespaceManager namespaceManager)
566
        {
567
            if (node == null)
568
                return null;
569
            CT_AreaChart ctObj = new CT_AreaChart();
570
            ctObj.ser = new List<CT_AreaSer>();
571
            ctObj.axId = new List<CT_UnsignedInt>();
572
            ctObj.extLst = new List<CT_Extension>();
573
            foreach (XmlNode childNode in node.ChildNodes)
574
            {
575
                if (childNode.LocalName == "grouping")
576
                    ctObj.grouping = CT_Grouping.Parse(childNode, namespaceManager);
577
                else if (childNode.LocalName == "varyColors")
578
                    ctObj.varyColors = CT_Boolean.Parse(childNode, namespaceManager);
579
                else if (childNode.LocalName == "dLbls")
580
                    ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
581
                else if (childNode.LocalName == "dropLines")
582
                    ctObj.dropLines = CT_ChartLines.Parse(childNode, namespaceManager);
583
                else if (childNode.LocalName == "ser")
584
                    ctObj.ser.Add(CT_AreaSer.Parse(childNode, namespaceManager));
585
                else if (childNode.LocalName == "axId")
586
                    ctObj.axId.Add(CT_UnsignedInt.Parse(childNode, namespaceManager));
587
                else if (childNode.LocalName == "extLst")
588
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
589
            }
590
            return ctObj;
591
        }
592

593

594

595
        internal void Write(StreamWriter sw, string nodeName)
596
        {
597
            sw.Write(string.Format("<c:{0}", nodeName));
598
            sw.Write(">");
599
            if (this.grouping != null)
600
                this.grouping.Write(sw, "grouping");
601
            if (this.varyColors != null)
602
                this.varyColors.Write(sw, "varyColors");
603
            if (this.dropLines != null)
604
                this.dropLines.Write(sw, "dropLines");
605
            if (this.ser != null)
606
            {
607
                foreach (CT_AreaSer x in this.ser)
608
                {
609
                    x.Write(sw, "ser");
610
                }
611
            }
612
            if (this.dLbls != null)
613
                this.dLbls.Write(sw, "dLbls");
614
            if (this.axId != null)
615
            {
616
                foreach (CT_UnsignedInt x in this.axId)
617
                {
618
                    x.Write(sw, "axId");
619
                }
620
            }
621
            if (this.extLst != null)
622
            {
623
                foreach (CT_Extension x in this.extLst)
624
                {
625
                    x.Write(sw, "extLst");
626
                }
627
            }
628
            sw.Write(string.Format("</c:{0}>", nodeName));
629
        }
630

631
        public int GetSeriesCount()
632
        {
633
            return this.serField == null ? 0 : this.serField.Count;
634
        }
635

636
        [XmlElement(Order = 0)]
637
        public CT_Grouping grouping
638
        {
639
            get
640
            {
641
                return this.groupingField;
642
            }
643
            set
644
            {
645
                this.groupingField = value;
646
            }
647
        }
648

649
        [XmlElement(Order = 1)]
650
        public CT_Boolean varyColors
651
        {
652
            get
653
            {
654
                return this.varyColorsField;
655
            }
656
            set
657
            {
658
                this.varyColorsField = value;
659
            }
660
        }
661

662
        [XmlElement("ser", Order = 2)]
663
        public List<CT_AreaSer> ser
664
        {
665
            get
666
            {
667
                return this.serField;
668
            }
669
            set
670
            {
671
                this.serField = value;
672
            }
673
        }
674

675
        [XmlElement(Order = 3)]
676
        public CT_DLbls dLbls
677
        {
678
            get
679
            {
680
                return this.dLblsField;
681
            }
682
            set
683
            {
684
                this.dLblsField = value;
685
            }
686
        }
687

688
        [XmlElement(Order = 4)]
689
        public CT_ChartLines dropLines
690
        {
691
            get
692
            {
693
                return this.dropLinesField;
694
            }
695
            set
696
            {
697
                this.dropLinesField = value;
698
            }
699
        }
700

701
        [XmlElement("axId", Order = 5)]
702
        public List<CT_UnsignedInt> axId
703
        {
704
            get
705
            {
706
                return this.axIdField;
707
            }
708
            set
709
            {
710
                this.axIdField = value;
711
            }
712
        }
713

714
        [XmlElement(Order = 6)]
715
        public List<CT_Extension> extLst
716
        {
717
            get
718
            {
719
                return this.extLstField;
720
            }
721
            set
722
            {
723
                this.extLstField = value;
724
            }
725
        }
726

727
        public CT_Boolean AddNewVaryColors()
728
        {
729
            this.varyColorsField = new CT_Boolean();
730
            return this.varyColorsField;
731
        }
732

733
        public CT_UnsignedInt AddNewAxId()
734
        {
735
            CT_UnsignedInt si = new CT_UnsignedInt();
736
            if (this.axIdField == null)
737
                this.axIdField = new List<CT_UnsignedInt>();
738
            axIdField.Add(si);
739
            return si;
740
        }
741

742
        public CT_AreaSer AddNewSer()
743
        {
744
            CT_AreaSer newSer = new CT_AreaSer();
745
            if (this.serField == null)
746
            {
747
                this.serField = new List<CT_AreaSer>();
748
            }
749
            this.serField.Add(newSer);
750
            return newSer;
751
        }
752
    }
753
}
754

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.