npoi

Форк
0
/
BubbleChart.cs 
671 строка · 18.6 Кб
1
using NPOI.OpenXml4Net.Util;
2
using System;
3
using System.Collections.Generic;
4
using System.ComponentModel;
5
using System.IO;
6
using System.Text;
7
using System.Xml;
8
using System.Xml.Serialization;
9

10
namespace NPOI.OpenXmlFormats.Dml.Chart
11
{
12

13
    [Serializable]
14

15
    [System.ComponentModel.DesignerCategoryAttribute("code")]
16
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
17
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
18
    public class CT_SizeRepresents
19
    {
20

21
        private ST_SizeRepresents valField;
22

23
        public CT_SizeRepresents()
24
        {
25
            this.valField = ST_SizeRepresents.area;
26
        }
27
        public static CT_SizeRepresents Parse(XmlNode node, XmlNamespaceManager namespaceManager)
28
        {
29
            if (node == null)
30
                return null;
31
            CT_SizeRepresents ctObj = new CT_SizeRepresents();
32
            if (node.Attributes["val"] != null)
33
                ctObj.val = (ST_SizeRepresents)Enum.Parse(typeof(ST_SizeRepresents), node.Attributes["val"].Value);
34
            return ctObj;
35
        }
36

37

38

39
        internal void Write(StreamWriter sw, string nodeName)
40
        {
41
            sw.Write(string.Format("<c:{0}", nodeName));
42
            XmlHelper.WriteAttribute(sw, "val", this.val.ToString());
43
            sw.Write(">");
44
            sw.Write(string.Format("</c:{0}>", nodeName));
45
        }
46

47
        [XmlAttribute]
48
        [DefaultValue(ST_SizeRepresents.area)]
49
        public ST_SizeRepresents val
50
        {
51
            get
52
            {
53
                return this.valField;
54
            }
55
            set
56
            {
57
                this.valField = value;
58
            }
59
        }
60
    }
61

62

63
    [Serializable]
64
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
65
    public enum ST_SizeRepresents
66
    {
67

68
        /// <remarks/>
69
        area,
70

71
        /// <remarks/>
72
        w,
73
    }
74
    [Serializable]
75
    [System.ComponentModel.DesignerCategoryAttribute("code")]
76
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
77
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
78
    public class CT_BubbleScale
79
    {
80

81
        private uint valField;
82

83
        public CT_BubbleScale()
84
        {
85
            this.valField = ((uint)(100));
86
        }
87
        public static CT_BubbleScale Parse(XmlNode node, XmlNamespaceManager namespaceManager)
88
        {
89
            if (node == null)
90
                return null;
91
            CT_BubbleScale ctObj = new CT_BubbleScale();
92
            if (node.Attributes["val"] != null)
93
                ctObj.val = XmlHelper.ReadUInt(node.Attributes["val"]);
94
            return ctObj;
95
        }
96

97

98

99
        internal void Write(StreamWriter sw, string nodeName)
100
        {
101
            sw.Write(string.Format("<c:{0}", nodeName));
102
            XmlHelper.WriteAttribute(sw, "val", this.val);
103
            sw.Write(">");
104
            sw.Write(string.Format("</c:{0}>", nodeName));
105
        }
106

107
        [XmlAttribute]
108
        [DefaultValue(typeof(uint), "100")]
109
        public uint val
110
        {
111
            get
112
            {
113
                return this.valField;
114
            }
115
            set
116
            {
117
                this.valField = value;
118
            }
119
        }
120
    }
121

122

123
    [Serializable]
124
    [System.ComponentModel.DesignerCategoryAttribute("code")]
125
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
126
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
127
    public class CT_BubbleSer
128
    {
129

130
        private CT_UnsignedInt idxField;
131

132
        private CT_UnsignedInt orderField;
133

134
        private CT_SerTx txField;
135

136
        private CT_ShapeProperties spPrField;
137

138
        private CT_Boolean invertIfNegativeField;
139

140
        private List<CT_DPt> dPtField;
141

142
        private CT_DLbls dLblsField;
143

144
        private List<CT_Trendline> trendlineField;
145

146
        private List<CT_ErrBars> errBarsField;
147

148
        private CT_AxDataSource xValField;
149

150
        private CT_NumDataSource yValField;
151

152
        private CT_NumDataSource bubbleSizeField;
153

154
        private CT_Boolean bubble3DField;
155

156
        private List<CT_Extension> extLstField;
157

158
        public CT_BubbleSer()
159
        {
160
        }
161
        public static CT_BubbleSer Parse(XmlNode node, XmlNamespaceManager namespaceManager)
162
        {
163
            if (node == null)
164
                return null;
165
            CT_BubbleSer ctObj = new CT_BubbleSer();
166
            ctObj.dPt = new List<CT_DPt>();
167
            ctObj.trendline = new List<CT_Trendline>();
168
            ctObj.errBars = new List<CT_ErrBars>();
169
            ctObj.extLst = new List<CT_Extension>();
170
            foreach (XmlNode childNode in node.ChildNodes)
171
            {
172
                if (childNode.LocalName == "idx")
173
                    ctObj.idx = CT_UnsignedInt.Parse(childNode, namespaceManager);
174
                else if (childNode.LocalName == "order")
175
                    ctObj.order = CT_UnsignedInt.Parse(childNode, namespaceManager);
176
                else if (childNode.LocalName == "tx")
177
                    ctObj.tx = CT_SerTx.Parse(childNode, namespaceManager);
178
                else if (childNode.LocalName == "spPr")
179
                    ctObj.spPr = CT_ShapeProperties.Parse(childNode, namespaceManager);
180
                else if (childNode.LocalName == "invertIfNegative")
181
                    ctObj.invertIfNegative = CT_Boolean.Parse(childNode, namespaceManager);
182
                else if (childNode.LocalName == "dLbls")
183
                    ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
184
                else if (childNode.LocalName == "xVal")
185
                    ctObj.xVal = CT_AxDataSource.Parse(childNode, namespaceManager);
186
                else if (childNode.LocalName == "yVal")
187
                    ctObj.yVal = CT_NumDataSource.Parse(childNode, namespaceManager);
188
                else if (childNode.LocalName == "bubbleSize")
189
                    ctObj.bubbleSize = CT_NumDataSource.Parse(childNode, namespaceManager);
190
                else if (childNode.LocalName == "bubble3D")
191
                    ctObj.bubble3D = CT_Boolean.Parse(childNode, namespaceManager);
192
                else if (childNode.LocalName == "dPt")
193
                    ctObj.dPt.Add(CT_DPt.Parse(childNode, namespaceManager));
194
                else if (childNode.LocalName == "trendline")
195
                    ctObj.trendline.Add(CT_Trendline.Parse(childNode, namespaceManager));
196
                else if (childNode.LocalName == "errBars")
197
                    ctObj.errBars.Add(CT_ErrBars.Parse(childNode, namespaceManager));
198
                else if (childNode.LocalName == "extLst")
199
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
200
            }
201
            return ctObj;
202
        }
203

204

205

206
        internal void Write(StreamWriter sw, string nodeName)
207
        {
208
            sw.Write(string.Format("<c:{0}", nodeName));
209
            sw.Write(">");
210
            if (this.idx != null)
211
                this.idx.Write(sw, "idx");
212
            if (this.order != null)
213
                this.order.Write(sw, "order");
214
            if (this.tx != null)
215
                this.tx.Write(sw, "tx");
216
            if (this.spPr != null)
217
                this.spPr.Write(sw, "spPr");
218
            if (this.invertIfNegative != null)
219
                this.invertIfNegative.Write(sw, "invertIfNegative");
220
            if (this.dLbls != null)
221
                this.dLbls.Write(sw, "dLbls");
222
            if (this.xVal != null)
223
                this.xVal.Write(sw, "xVal");
224
            if (this.yVal != null)
225
                this.yVal.Write(sw, "yVal");
226
            if (this.bubbleSize != null)
227
                this.bubbleSize.Write(sw, "bubbleSize");
228
            if (this.bubble3D != null)
229
                this.bubble3D.Write(sw, "bubble3D");
230
            if (this.dPt != null)
231
            {
232
                foreach (CT_DPt x in this.dPt)
233
                {
234
                    x.Write(sw, "dPt");
235
                }
236
            }
237
            if (this.trendline != null)
238
            {
239
                foreach (CT_Trendline x in this.trendline)
240
                {
241
                    x.Write(sw, "trendline");
242
                }
243
            }
244
            if (this.errBars != null)
245
            {
246
                foreach (CT_ErrBars x in this.errBars)
247
                {
248
                    x.Write(sw, "errBars");
249
                }
250
            }
251
            if (this.extLst != null)
252
            {
253
                foreach (CT_Extension x in this.extLst)
254
                {
255
                    x.Write(sw, "extLst");
256
                }
257
            }
258
            sw.Write(string.Format("</c:{0}>", nodeName));
259
        }
260

261

262
        [XmlElement(Order = 0)]
263
        public CT_UnsignedInt idx
264
        {
265
            get
266
            {
267
                return this.idxField;
268
            }
269
            set
270
            {
271
                this.idxField = value;
272
            }
273
        }
274

275
        [XmlElement(Order = 1)]
276
        public CT_UnsignedInt order
277
        {
278
            get
279
            {
280
                return this.orderField;
281
            }
282
            set
283
            {
284
                this.orderField = value;
285
            }
286
        }
287

288
        [XmlElement(Order = 2)]
289
        public CT_SerTx tx
290
        {
291
            get
292
            {
293
                return this.txField;
294
            }
295
            set
296
            {
297
                this.txField = value;
298
            }
299
        }
300

301
        [XmlElement(Order = 3)]
302
        public CT_ShapeProperties spPr
303
        {
304
            get
305
            {
306
                return this.spPrField;
307
            }
308
            set
309
            {
310
                this.spPrField = value;
311
            }
312
        }
313

314
        [XmlElement(Order = 4)]
315
        public CT_Boolean invertIfNegative
316
        {
317
            get
318
            {
319
                return this.invertIfNegativeField;
320
            }
321
            set
322
            {
323
                this.invertIfNegativeField = value;
324
            }
325
        }
326

327
        [XmlElement("dPt", Order = 5)]
328
        public List<CT_DPt> dPt
329
        {
330
            get
331
            {
332
                return this.dPtField;
333
            }
334
            set
335
            {
336
                this.dPtField = value;
337
            }
338
        }
339

340
        [XmlElement(Order = 6)]
341
        public CT_DLbls dLbls
342
        {
343
            get
344
            {
345
                return this.dLblsField;
346
            }
347
            set
348
            {
349
                this.dLblsField = value;
350
            }
351
        }
352

353
        [XmlElement("trendline", Order = 7)]
354
        public List<CT_Trendline> trendline
355
        {
356
            get
357
            {
358
                return this.trendlineField;
359
            }
360
            set
361
            {
362
                this.trendlineField = value;
363
            }
364
        }
365

366
        [XmlElement("errBars", Order = 8)]
367
        public List<CT_ErrBars> errBars
368
        {
369
            get
370
            {
371
                return this.errBarsField;
372
            }
373
            set
374
            {
375
                this.errBarsField = value;
376
            }
377
        }
378

379
        [XmlElement(Order = 9)]
380
        public CT_AxDataSource xVal
381
        {
382
            get
383
            {
384
                return this.xValField;
385
            }
386
            set
387
            {
388
                this.xValField = value;
389
            }
390
        }
391

392
        [XmlElement(Order = 10)]
393
        public CT_NumDataSource yVal
394
        {
395
            get
396
            {
397
                return this.yValField;
398
            }
399
            set
400
            {
401
                this.yValField = value;
402
            }
403
        }
404

405
        [XmlElement(Order = 11)]
406
        public CT_NumDataSource bubbleSize
407
        {
408
            get
409
            {
410
                return this.bubbleSizeField;
411
            }
412
            set
413
            {
414
                this.bubbleSizeField = value;
415
            }
416
        }
417

418
        [XmlElement(Order = 12)]
419
        public CT_Boolean bubble3D
420
        {
421
            get
422
            {
423
                return this.bubble3DField;
424
            }
425
            set
426
            {
427
                this.bubble3DField = value;
428
            }
429
        }
430

431
        [XmlElement(Order = 13)]
432
        public List<CT_Extension> extLst
433
        {
434
            get
435
            {
436
                return this.extLstField;
437
            }
438
            set
439
            {
440
                this.extLstField = value;
441
            }
442
        }
443
    }
444
    [Serializable]
445
    [System.ComponentModel.DesignerCategoryAttribute("code")]
446
    [XmlType(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart")]
447
    [XmlRoot(Namespace = "http://schemas.openxmlformats.org/drawingml/2006/chart", IsNullable = true)]
448
    public class CT_BubbleChart
449
    {
450

451
        private CT_Boolean varyColorsField;
452

453
        private List<CT_BubbleSer> serField;
454

455
        private CT_DLbls dLblsField;
456

457
        private CT_Boolean bubble3DField;
458

459
        private CT_BubbleScale bubbleScaleField;
460

461
        private CT_Boolean showNegBubblesField;
462

463
        private CT_SizeRepresents sizeRepresentsField;
464

465
        private List<CT_UnsignedInt> axIdField;
466

467
        private List<CT_Extension> extLstField;
468

469
        public CT_BubbleChart()
470
        {
471

472
        }
473
        public static CT_BubbleChart Parse(XmlNode node, XmlNamespaceManager namespaceManager)
474
        {
475
            if (node == null)
476
                return null;
477
            CT_BubbleChart ctObj = new CT_BubbleChart();
478
            ctObj.ser = new List<CT_BubbleSer>();
479
            ctObj.axId = new List<CT_UnsignedInt>();
480
            ctObj.extLst = new List<CT_Extension>();
481
            foreach (XmlNode childNode in node.ChildNodes)
482
            {
483
                if (childNode.LocalName == "varyColors")
484
                    ctObj.varyColors = CT_Boolean.Parse(childNode, namespaceManager);
485
                else if (childNode.LocalName == "dLbls")
486
                    ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
487
                else if (childNode.LocalName == "bubble3D")
488
                    ctObj.bubble3D = CT_Boolean.Parse(childNode, namespaceManager);
489
                else if (childNode.LocalName == "bubbleScale")
490
                    ctObj.bubbleScale = CT_BubbleScale.Parse(childNode, namespaceManager);
491
                else if (childNode.LocalName == "showNegBubbles")
492
                    ctObj.showNegBubbles = CT_Boolean.Parse(childNode, namespaceManager);
493
                else if (childNode.LocalName == "sizeRepresents")
494
                    ctObj.sizeRepresents = CT_SizeRepresents.Parse(childNode, namespaceManager);
495
                else if (childNode.LocalName == "ser")
496
                    ctObj.ser.Add(CT_BubbleSer.Parse(childNode, namespaceManager));
497
                else if (childNode.LocalName == "axId")
498
                    ctObj.axId.Add(CT_UnsignedInt.Parse(childNode, namespaceManager));
499
                else if (childNode.LocalName == "extLst")
500
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
501
            }
502
            return ctObj;
503
        }
504

505

506

507
        internal void Write(StreamWriter sw, string nodeName)
508
        {
509
            sw.Write(string.Format("<c:{0}", nodeName));
510
            sw.Write(">");
511
            if (this.varyColors != null)
512
                this.varyColors.Write(sw, "varyColors");
513
            if (this.dLbls != null)
514
                this.dLbls.Write(sw, "dLbls");
515
            if (this.bubble3D != null)
516
                this.bubble3D.Write(sw, "bubble3D");
517
            if (this.bubbleScale != null)
518
                this.bubbleScale.Write(sw, "bubbleScale");
519
            if (this.showNegBubbles != null)
520
                this.showNegBubbles.Write(sw, "showNegBubbles");
521
            if (this.sizeRepresents != null)
522
                this.sizeRepresents.Write(sw, "sizeRepresents");
523
            if (this.ser != null)
524
            {
525
                foreach (CT_BubbleSer x in this.ser)
526
                {
527
                    x.Write(sw, "ser");
528
                }
529
            }
530
            if (this.axId != null)
531
            {
532
                foreach (CT_UnsignedInt x in this.axId)
533
                {
534
                    x.Write(sw, "axId");
535
                }
536
            }
537
            if (this.extLst != null)
538
            {
539
                foreach (CT_Extension x in this.extLst)
540
                {
541
                    x.Write(sw, "extLst");
542
                }
543
            }
544
            sw.Write(string.Format("</c:{0}>", nodeName));
545
        }
546

547
        public int GetSeriesCount()
548
        {
549
            return this.serField == null ? 0 : this.serField.Count;
550
        }
551

552
        [XmlElement(Order = 0)]
553
        public CT_Boolean varyColors
554
        {
555
            get
556
            {
557
                return this.varyColorsField;
558
            }
559
            set
560
            {
561
                this.varyColorsField = value;
562
            }
563
        }
564

565
        [XmlElement("ser", Order = 1)]
566
        public List<CT_BubbleSer> ser
567
        {
568
            get
569
            {
570
                return this.serField;
571
            }
572
            set
573
            {
574
                this.serField = value;
575
            }
576
        }
577

578
        [XmlElement(Order = 2)]
579
        public CT_DLbls dLbls
580
        {
581
            get
582
            {
583
                return this.dLblsField;
584
            }
585
            set
586
            {
587
                this.dLblsField = value;
588
            }
589
        }
590

591
        [XmlElement(Order = 3)]
592
        public CT_Boolean bubble3D
593
        {
594
            get
595
            {
596
                return this.bubble3DField;
597
            }
598
            set
599
            {
600
                this.bubble3DField = value;
601
            }
602
        }
603

604
        [XmlElement(Order = 4)]
605
        public CT_BubbleScale bubbleScale
606
        {
607
            get
608
            {
609
                return this.bubbleScaleField;
610
            }
611
            set
612
            {
613
                this.bubbleScaleField = value;
614
            }
615
        }
616

617
        [XmlElement(Order = 5)]
618
        public CT_Boolean showNegBubbles
619
        {
620
            get
621
            {
622
                return this.showNegBubblesField;
623
            }
624
            set
625
            {
626
                this.showNegBubblesField = value;
627
            }
628
        }
629

630
        [XmlElement(Order = 6)]
631
        public CT_SizeRepresents sizeRepresents
632
        {
633
            get
634
            {
635
                return this.sizeRepresentsField;
636
            }
637
            set
638
            {
639
                this.sizeRepresentsField = value;
640
            }
641
        }
642

643
        [XmlElement("axId", Order = 7)]
644
        public List<CT_UnsignedInt> axId
645
        {
646
            get
647
            {
648
                return this.axIdField;
649
            }
650
            set
651
            {
652
                this.axIdField = value;
653
            }
654
        }
655

656
        [XmlElement(Order = 8)]
657
        public List<CT_Extension> extLst
658
        {
659
            get
660
            {
661
                return this.extLstField;
662
            }
663
            set
664
            {
665
                this.extLstField = value;
666
            }
667
        }
668
    }
669

670

671
}
672

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

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

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

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