2017-08-28 20:56:18 -05:00
|
|
|
// Copyright 2017 Baliance. All rights reserved.
|
|
|
|
//
|
2017-09-09 10:21:47 -05:00
|
|
|
// DO NOT EDIT: generated by gooxml ECMA-376 generator
|
|
|
|
//
|
2017-08-28 20:56:18 -05:00
|
|
|
// Use of this source code is governed by the terms of the Affero GNU General
|
|
|
|
// Public License version 3.0 as published by the Free Software Foundation and
|
|
|
|
// appearing in the file LICENSE included in the packaging of this file. A
|
|
|
|
// commercial license can be purchased by contacting sales@baliance.com.
|
|
|
|
|
|
|
|
package chart
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/xml"
|
|
|
|
"fmt"
|
|
|
|
|
2017-09-29 20:52:19 -05:00
|
|
|
"baliance.com/gooxml"
|
2017-09-23 08:39:08 -05:00
|
|
|
"baliance.com/gooxml/schema/soo/dml"
|
2017-08-28 20:56:18 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type CT_PlotArea struct {
|
|
|
|
Layout *CT_Layout
|
|
|
|
Choice []*CT_PlotAreaChoice
|
2017-09-03 16:46:41 -05:00
|
|
|
CChoice *CT_PlotAreaChoice1
|
2017-08-28 20:56:18 -05:00
|
|
|
DTable *CT_DTable
|
2017-09-23 08:39:08 -05:00
|
|
|
SpPr *dml.CT_ShapeProperties
|
2017-08-28 20:56:18 -05:00
|
|
|
ExtLst *CT_ExtensionList
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewCT_PlotArea() *CT_PlotArea {
|
|
|
|
ret := &CT_PlotArea{}
|
|
|
|
return ret
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *CT_PlotArea) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
|
|
|
e.EncodeToken(start)
|
|
|
|
if m.Layout != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
selayout := xml.StartElement{Name: xml.Name{Local: "c:layout"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.Layout, selayout)
|
|
|
|
}
|
|
|
|
for _, c := range m.Choice {
|
2017-09-04 13:47:32 -05:00
|
|
|
c.MarshalXML(e, xml.StartElement{})
|
2017-08-28 20:56:18 -05:00
|
|
|
}
|
|
|
|
if m.CChoice != nil {
|
2017-09-04 13:47:32 -05:00
|
|
|
m.CChoice.MarshalXML(e, xml.StartElement{})
|
2017-08-28 20:56:18 -05:00
|
|
|
}
|
|
|
|
if m.DTable != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
sedTable := xml.StartElement{Name: xml.Name{Local: "c:dTable"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.DTable, sedTable)
|
|
|
|
}
|
|
|
|
if m.SpPr != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
sespPr := xml.StartElement{Name: xml.Name{Local: "c:spPr"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.SpPr, sespPr)
|
|
|
|
}
|
|
|
|
if m.ExtLst != nil {
|
2017-09-03 09:29:13 -05:00
|
|
|
seextLst := xml.StartElement{Name: xml.Name{Local: "c:extLst"}}
|
2017-08-28 20:56:18 -05:00
|
|
|
e.EncodeElement(m.ExtLst, seextLst)
|
|
|
|
}
|
|
|
|
e.EncodeToken(xml.EndElement{Name: start.Name})
|
|
|
|
return nil
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *CT_PlotArea) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
|
|
|
// initialize to default
|
|
|
|
lCT_PlotArea:
|
|
|
|
for {
|
|
|
|
tok, err := d.Token()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
switch el := tok.(type) {
|
|
|
|
case xml.StartElement:
|
2017-09-10 10:02:39 -05:00
|
|
|
switch el.Name {
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "layout"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "layout"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.Layout = NewCT_Layout()
|
|
|
|
if err := d.DecodeElement(m.Layout, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "areaChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "areaChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.AreaChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "area3DChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "area3DChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.Area3DChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "lineChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "lineChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.LineChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "line3DChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "line3DChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.Line3DChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "stockChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "stockChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.StockChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "radarChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "radarChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.RadarChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "scatterChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "scatterChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.ScatterChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "pieChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "pieChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.PieChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "pie3DChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "pie3DChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.Pie3DChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "doughnutChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "doughnutChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.DoughnutChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "barChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "barChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.BarChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "bar3DChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "bar3DChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.Bar3DChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "ofPieChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "ofPieChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.OfPieChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "surfaceChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "surfaceChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.SurfaceChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "surface3DChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "surface3DChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.Surface3DChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "bubbleChart"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "bubbleChart"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
tmp := NewCT_PlotAreaChoice()
|
|
|
|
if err := d.DecodeElement(&tmp.BubbleChart, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
m.Choice = append(m.Choice, tmp)
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "valAx"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "valAx"}:
|
2017-09-03 16:46:41 -05:00
|
|
|
m.CChoice = NewCT_PlotAreaChoice1()
|
|
|
|
if err := d.DecodeElement(&m.CChoice.ValAx, &el); err != nil {
|
2017-08-28 20:56:18 -05:00
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "catAx"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "catAx"}:
|
2017-09-03 16:46:41 -05:00
|
|
|
m.CChoice = NewCT_PlotAreaChoice1()
|
|
|
|
if err := d.DecodeElement(&m.CChoice.CatAx, &el); err != nil {
|
2017-08-28 20:56:18 -05:00
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "dateAx"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "dateAx"}:
|
2017-09-03 16:46:41 -05:00
|
|
|
m.CChoice = NewCT_PlotAreaChoice1()
|
|
|
|
if err := d.DecodeElement(&m.CChoice.DateAx, &el); err != nil {
|
2017-08-28 20:56:18 -05:00
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "serAx"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "serAx"}:
|
2017-09-03 16:46:41 -05:00
|
|
|
m.CChoice = NewCT_PlotAreaChoice1()
|
|
|
|
if err := d.DecodeElement(&m.CChoice.SerAx, &el); err != nil {
|
2017-08-28 20:56:18 -05:00
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "dTable"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "dTable"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.DTable = NewCT_DTable()
|
|
|
|
if err := d.DecodeElement(m.DTable, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "spPr"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "spPr"}:
|
2017-09-23 08:39:08 -05:00
|
|
|
m.SpPr = dml.NewCT_ShapeProperties()
|
2017-08-28 20:56:18 -05:00
|
|
|
if err := d.DecodeElement(m.SpPr, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-04-29 18:32:26 +03:00
|
|
|
case xml.Name{Space: "http://schemas.openxmlformats.org/drawingml/2006/chart", Local: "extLst"},
|
|
|
|
xml.Name{Space: "http://purl.oclc.org/ooxml/drawingml/chart", Local: "extLst"}:
|
2017-08-28 20:56:18 -05:00
|
|
|
m.ExtLst = NewCT_ExtensionList()
|
|
|
|
if err := d.DecodeElement(m.ExtLst, &el); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
default:
|
2017-09-29 20:52:19 -05:00
|
|
|
gooxml.Log("skipping unsupported element on CT_PlotArea %v", el.Name)
|
2017-08-28 20:56:18 -05:00
|
|
|
if err := d.Skip(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case xml.EndElement:
|
|
|
|
break lCT_PlotArea
|
|
|
|
case xml.CharData:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
|
|
|
// Validate validates the CT_PlotArea and its children
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *CT_PlotArea) Validate() error {
|
|
|
|
return m.ValidateWithPath("CT_PlotArea")
|
|
|
|
}
|
2017-09-01 15:19:23 -05:00
|
|
|
|
|
|
|
// ValidateWithPath validates the CT_PlotArea and its children, prefixing error messages with path
|
2017-08-28 20:56:18 -05:00
|
|
|
func (m *CT_PlotArea) ValidateWithPath(path string) error {
|
|
|
|
if m.Layout != nil {
|
|
|
|
if err := m.Layout.ValidateWithPath(path + "/Layout"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for i, v := range m.Choice {
|
|
|
|
if err := v.ValidateWithPath(fmt.Sprintf("%s/Choice[%d]", path, i)); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2017-09-03 16:46:41 -05:00
|
|
|
if m.CChoice != nil {
|
|
|
|
if err := m.CChoice.ValidateWithPath(path + "/CChoice"); err != nil {
|
2017-08-28 20:56:18 -05:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.DTable != nil {
|
|
|
|
if err := m.DTable.ValidateWithPath(path + "/DTable"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.SpPr != nil {
|
|
|
|
if err := m.SpPr.ValidateWithPath(path + "/SpPr"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if m.ExtLst != nil {
|
|
|
|
if err := m.ExtLst.ValidateWithPath(path + "/ExtLst"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|