xmlChart.go 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. // Copyright 2016 - 2023 The excelize Authors. All rights reserved. Use of
  2. // this source code is governed by a BSD-style license that can be found in
  3. // the LICENSE file.
  4. //
  5. // Package excelize providing a set of functions that allow you to write to and
  6. // read from XLAM / XLSM / XLSX / XLTM / XLTX files. Supports reading and
  7. // writing spreadsheet documents generated by Microsoft Excel™ 2007 and later.
  8. // Supports complex components by high compatibility, and provided streaming
  9. // API for generating or reading data from a worksheet with huge amounts of
  10. // data. This library needs Go version 1.16 or later.
  11. package excelize
  12. import "encoding/xml"
  13. // xlsxChartSpace directly maps the chartSpace element. The chart namespace in
  14. // DrawingML is for representing visualizations of numeric data with column
  15. // charts, pie charts, scatter charts, or other types of charts.
  16. type xlsxChartSpace struct {
  17. XMLName xml.Name `xml:"http://schemas.openxmlformats.org/drawingml/2006/chart chartSpace"`
  18. XMLNSa string `xml:"xmlns:a,attr"`
  19. Date1904 *attrValBool `xml:"date1904"`
  20. Lang *attrValString `xml:"lang"`
  21. RoundedCorners *attrValBool `xml:"roundedCorners"`
  22. Chart cChart `xml:"chart"`
  23. SpPr *cSpPr `xml:"spPr"`
  24. TxPr *cTxPr `xml:"txPr"`
  25. PrintSettings *cPrintSettings `xml:"printSettings"`
  26. }
  27. // cThicknessSpPr directly maps the element that specifies the thickness of
  28. // the walls or floor as a percentage of the largest dimension of the plot
  29. // volume and SpPr element.
  30. type cThicknessSpPr struct {
  31. Thickness *attrValInt `xml:"thickness"`
  32. SpPr *cSpPr `xml:"spPr"`
  33. }
  34. // cChart (Chart) directly maps the chart element. This element specifies a
  35. // title.
  36. type cChart struct {
  37. Title *cTitle `xml:"title"`
  38. AutoTitleDeleted *cAutoTitleDeleted `xml:"autoTitleDeleted"`
  39. View3D *cView3D `xml:"view3D"`
  40. Floor *cThicknessSpPr `xml:"floor"`
  41. SideWall *cThicknessSpPr `xml:"sideWall"`
  42. BackWall *cThicknessSpPr `xml:"backWall"`
  43. PlotArea *cPlotArea `xml:"plotArea"`
  44. Legend *cLegend `xml:"legend"`
  45. PlotVisOnly *attrValBool `xml:"plotVisOnly"`
  46. DispBlanksAs *attrValString `xml:"dispBlanksAs"`
  47. ShowDLblsOverMax *attrValBool `xml:"showDLblsOverMax"`
  48. }
  49. // cTitle (Title) directly maps the title element. This element specifies a
  50. // title.
  51. type cTitle struct {
  52. Tx cTx `xml:"tx,omitempty"`
  53. Layout string `xml:"layout,omitempty"`
  54. Overlay *attrValBool `xml:"overlay"`
  55. SpPr cSpPr `xml:"spPr,omitempty"`
  56. TxPr cTxPr `xml:"txPr,omitempty"`
  57. }
  58. // cTx (Chart Text) directly maps the tx element. This element specifies text
  59. // to use on a chart, including rich text formatting.
  60. type cTx struct {
  61. StrRef *cStrRef `xml:"strRef"`
  62. Rich *cRich `xml:"rich,omitempty"`
  63. }
  64. // cRich (Rich Text) directly maps the rich element. This element contains a
  65. // string with rich text formatting.
  66. type cRich struct {
  67. BodyPr aBodyPr `xml:"a:bodyPr,omitempty"`
  68. LstStyle string `xml:"a:lstStyle,omitempty"`
  69. P aP `xml:"a:p"`
  70. }
  71. // aBodyPr (Body Properties) directly maps the a:bodyPr element. This element
  72. // defines the body properties for the text body within a shape.
  73. type aBodyPr struct {
  74. Anchor string `xml:"anchor,attr,omitempty"`
  75. AnchorCtr bool `xml:"anchorCtr,attr"`
  76. Rot int `xml:"rot,attr"`
  77. BIns float64 `xml:"bIns,attr,omitempty"`
  78. CompatLnSpc bool `xml:"compatLnSpc,attr,omitempty"`
  79. ForceAA bool `xml:"forceAA,attr,omitempty"`
  80. FromWordArt bool `xml:"fromWordArt,attr,omitempty"`
  81. HorzOverflow string `xml:"horzOverflow,attr,omitempty"`
  82. LIns float64 `xml:"lIns,attr,omitempty"`
  83. NumCol int `xml:"numCol,attr,omitempty"`
  84. RIns float64 `xml:"rIns,attr,omitempty"`
  85. RtlCol bool `xml:"rtlCol,attr,omitempty"`
  86. SpcCol int `xml:"spcCol,attr,omitempty"`
  87. SpcFirstLastPara bool `xml:"spcFirstLastPara,attr"`
  88. TIns float64 `xml:"tIns,attr,omitempty"`
  89. Upright bool `xml:"upright,attr,omitempty"`
  90. Vert string `xml:"vert,attr,omitempty"`
  91. VertOverflow string `xml:"vertOverflow,attr,omitempty"`
  92. Wrap string `xml:"wrap,attr,omitempty"`
  93. }
  94. // aP (Paragraph) directly maps the a:p element. This element specifies a
  95. // paragraph of content in the document.
  96. type aP struct {
  97. PPr *aPPr `xml:"a:pPr"`
  98. R *aR `xml:"a:r"`
  99. EndParaRPr *aEndParaRPr `xml:"a:endParaRPr"`
  100. }
  101. // aPPr (Paragraph Properties) directly maps the a:pPr element. This element
  102. // specifies a set of paragraph properties which shall be applied to the
  103. // contents of the parent paragraph after all style/numbering/table properties
  104. // have been applied to the text. These properties are defined as direct
  105. // formatting, since they are directly applied to the paragraph and supersede
  106. // any formatting from styles.
  107. type aPPr struct {
  108. DefRPr aRPr `xml:"a:defRPr"`
  109. }
  110. // aSolidFill (Solid Fill) directly maps the solidFill element. This element
  111. // specifies a solid color fill. The shape is filled entirely with the specified
  112. // color.
  113. type aSolidFill struct {
  114. SchemeClr *aSchemeClr `xml:"a:schemeClr"`
  115. SrgbClr *attrValString `xml:"a:srgbClr"`
  116. }
  117. // aSchemeClr (Scheme Color) directly maps the a:schemeClr element. This
  118. // element specifies a color bound to a user's theme. As with all elements which
  119. // define a color, it is possible to apply a list of color transforms to the
  120. // base color defined.
  121. type aSchemeClr struct {
  122. Val string `xml:"val,attr,omitempty"`
  123. LumMod *attrValInt `xml:"a:lumMod"`
  124. LumOff *attrValInt `xml:"a:lumOff"`
  125. }
  126. // attrValInt directly maps the val element with integer data type as an
  127. // attribute.
  128. type attrValInt struct {
  129. Val *int `xml:"val,attr"`
  130. }
  131. // attrValFloat directly maps the val element with float64 data type as an
  132. // attribute.
  133. type attrValFloat struct {
  134. Val *float64 `xml:"val,attr"`
  135. }
  136. // attrValBool directly maps the val element with boolean data type as an
  137. // attribute.
  138. type attrValBool struct {
  139. Val *bool `xml:"val,attr"`
  140. }
  141. // attrValString directly maps the val element with string data type as an
  142. // attribute.
  143. type attrValString struct {
  144. Val *string `xml:"val,attr"`
  145. }
  146. // aCs directly maps the a:cs element.
  147. type aCs struct {
  148. Typeface string `xml:"typeface,attr"`
  149. }
  150. // aEa directly maps the a:ea element.
  151. type aEa struct {
  152. Typeface string `xml:"typeface,attr"`
  153. }
  154. type xlsxCTTextFont struct {
  155. Typeface string `xml:"typeface,attr"`
  156. Panose string `xml:"panose,attr,omitempty"`
  157. PitchFamily string `xml:"pitchFamily,attr,omitempty"`
  158. Charset string `xml:"Charset,attr,omitempty"`
  159. }
  160. // aR directly maps the a:r element.
  161. type aR struct {
  162. RPr aRPr `xml:"a:rPr,omitempty"`
  163. T string `xml:"a:t,omitempty"`
  164. }
  165. // aRPr (Run Properties) directly maps the rPr element. This element
  166. // specifies a set of run properties which shall be applied to the contents of
  167. // the parent run after all style formatting has been applied to the text. These
  168. // properties are defined as direct formatting, since they are directly applied
  169. // to the run and supersede any formatting from styles.
  170. type aRPr struct {
  171. AltLang string `xml:"altLang,attr,omitempty"`
  172. B bool `xml:"b,attr"`
  173. Baseline int `xml:"baseline,attr"`
  174. Bmk string `xml:"bmk,attr,omitempty"`
  175. Cap string `xml:"cap,attr,omitempty"`
  176. Dirty bool `xml:"dirty,attr,omitempty"`
  177. Err bool `xml:"err,attr,omitempty"`
  178. I bool `xml:"i,attr"`
  179. Kern int `xml:"kern,attr"`
  180. Kumimoji bool `xml:"kumimoji,attr,omitempty"`
  181. Lang string `xml:"lang,attr,omitempty"`
  182. NoProof bool `xml:"noProof,attr,omitempty"`
  183. NormalizeH bool `xml:"normalizeH,attr,omitempty"`
  184. SmtClean bool `xml:"smtClean,attr,omitempty"`
  185. SmtID uint64 `xml:"smtId,attr,omitempty"`
  186. Spc int `xml:"spc,attr"`
  187. Strike string `xml:"strike,attr,omitempty"`
  188. Sz float64 `xml:"sz,attr,omitempty"`
  189. U string `xml:"u,attr,omitempty"`
  190. SolidFill *aSolidFill `xml:"a:solidFill"`
  191. Latin *xlsxCTTextFont `xml:"a:latin"`
  192. Ea *aEa `xml:"a:ea"`
  193. Cs *aCs `xml:"a:cs"`
  194. }
  195. // cSpPr (Shape Properties) directly maps the spPr element. This element
  196. // specifies the visual shape properties that can be applied to a shape. These
  197. // properties include the shape fill, outline, geometry, effects, and 3D
  198. // orientation.
  199. type cSpPr struct {
  200. NoFill *string `xml:"a:noFill"`
  201. SolidFill *aSolidFill `xml:"a:solidFill"`
  202. Ln *aLn `xml:"a:ln"`
  203. Sp3D *aSp3D `xml:"a:sp3d"`
  204. EffectLst *string `xml:"a:effectLst"`
  205. }
  206. // aSp3D (3-D Shape Properties) directly maps the a:sp3d element. This element
  207. // defines the 3D properties associated with a particular shape in DrawingML.
  208. // The 3D properties which can be applied to a shape are top and bottom bevels,
  209. // a contour and an extrusion.
  210. type aSp3D struct {
  211. ContourW int `xml:"contourW,attr"`
  212. ContourClr *aContourClr `xml:"a:contourClr"`
  213. }
  214. // aContourClr (Contour Color) directly maps the a:contourClr element. This
  215. // element defines the color for the contour on a shape. The contour of a shape
  216. // is a solid filled line which surrounds the outer edges of the shape.
  217. type aContourClr struct {
  218. SchemeClr *aSchemeClr `xml:"a:schemeClr"`
  219. }
  220. // aLn (Outline) directly maps the a:ln element. This element specifies an
  221. // outline style that can be applied to a number of different objects such as
  222. // shapes and text. The line allows for the specifying of many different types
  223. // of outlines including even line dashes and bevels.
  224. type aLn struct {
  225. Algn string `xml:"algn,attr,omitempty"`
  226. Cap string `xml:"cap,attr,omitempty"`
  227. Cmpd string `xml:"cmpd,attr,omitempty"`
  228. W int `xml:"w,attr,omitempty"`
  229. NoFill string `xml:"a:noFill,omitempty"`
  230. Round string `xml:"a:round,omitempty"`
  231. SolidFill *aSolidFill `xml:"a:solidFill"`
  232. }
  233. // cTxPr (Text Properties) directly maps the txPr element. This element
  234. // specifies text formatting. The lstStyle element is not supported.
  235. type cTxPr struct {
  236. BodyPr aBodyPr `xml:"a:bodyPr,omitempty"`
  237. LstStyle string `xml:"a:lstStyle,omitempty"`
  238. P aP `xml:"a:p,omitempty"`
  239. }
  240. // aEndParaRPr (End Paragraph Run Properties) directly maps the a:endParaRPr
  241. // element. This element specifies the text run properties that are to be used
  242. // if another run is inserted after the last run specified. This effectively
  243. // saves the run property state so that it can be applied when the user enters
  244. // additional text. If this element is omitted, then the application can
  245. // determine which default properties to apply. It is recommended that this
  246. // element be specified at the end of the list of text runs within the paragraph
  247. // so that an orderly list is maintained.
  248. type aEndParaRPr struct {
  249. Lang string `xml:"lang,attr"`
  250. AltLang string `xml:"altLang,attr,omitempty"`
  251. Sz int `xml:"sz,attr,omitempty"`
  252. }
  253. // cAutoTitleDeleted (Auto Title Is Deleted) directly maps the
  254. // autoTitleDeleted element. This element specifies the title shall not be
  255. // shown for this chart.
  256. type cAutoTitleDeleted struct {
  257. Val bool `xml:"val,attr"`
  258. }
  259. // cView3D (View In 3D) directly maps the view3D element. This element
  260. // specifies the 3-D view of the chart.
  261. type cView3D struct {
  262. RotX *attrValInt `xml:"rotX"`
  263. RotY *attrValInt `xml:"rotY"`
  264. RAngAx *attrValInt `xml:"rAngAx"`
  265. DepthPercent *attrValInt `xml:"depthPercent"`
  266. Perspective *attrValInt `xml:"perspective"`
  267. ExtLst *xlsxExtLst `xml:"extLst"`
  268. }
  269. // cPlotArea directly maps the plotArea element. This element specifies the
  270. // plot area of the chart.
  271. type cPlotArea struct {
  272. Layout *string `xml:"layout"`
  273. AreaChart *cCharts `xml:"areaChart"`
  274. Area3DChart *cCharts `xml:"area3DChart"`
  275. BarChart *cCharts `xml:"barChart"`
  276. Bar3DChart *cCharts `xml:"bar3DChart"`
  277. BubbleChart *cCharts `xml:"bubbleChart"`
  278. DoughnutChart *cCharts `xml:"doughnutChart"`
  279. LineChart *cCharts `xml:"lineChart"`
  280. Line3DChart *cCharts `xml:"line3DChart"`
  281. PieChart *cCharts `xml:"pieChart"`
  282. Pie3DChart *cCharts `xml:"pie3DChart"`
  283. OfPieChart *cCharts `xml:"ofPieChart"`
  284. RadarChart *cCharts `xml:"radarChart"`
  285. ScatterChart *cCharts `xml:"scatterChart"`
  286. Surface3DChart *cCharts `xml:"surface3DChart"`
  287. SurfaceChart *cCharts `xml:"surfaceChart"`
  288. CatAx []*cAxs `xml:"catAx"`
  289. ValAx []*cAxs `xml:"valAx"`
  290. SerAx []*cAxs `xml:"serAx"`
  291. SpPr *cSpPr `xml:"spPr"`
  292. }
  293. // cCharts specifies the common element of the chart.
  294. type cCharts struct {
  295. BarDir *attrValString `xml:"barDir"`
  296. BubbleScale *attrValFloat `xml:"bubbleScale"`
  297. Grouping *attrValString `xml:"grouping"`
  298. RadarStyle *attrValString `xml:"radarStyle"`
  299. ScatterStyle *attrValString `xml:"scatterStyle"`
  300. OfPieType *attrValString `xml:"ofPieType"`
  301. VaryColors *attrValBool `xml:"varyColors"`
  302. Wireframe *attrValBool `xml:"wireframe"`
  303. Ser *[]cSer `xml:"ser"`
  304. SplitPos *attrValInt `xml:"splitPos"`
  305. SerLines *attrValString `xml:"serLines"`
  306. DLbls *cDLbls `xml:"dLbls"`
  307. Shape *attrValString `xml:"shape"`
  308. HoleSize *attrValInt `xml:"holeSize"`
  309. Smooth *attrValBool `xml:"smooth"`
  310. Overlap *attrValInt `xml:"overlap"`
  311. AxID []*attrValInt `xml:"axId"`
  312. }
  313. // cAxs directly maps the catAx and valAx element.
  314. type cAxs struct {
  315. AxID *attrValInt `xml:"axId"`
  316. Scaling *cScaling `xml:"scaling"`
  317. Delete *attrValBool `xml:"delete"`
  318. AxPos *attrValString `xml:"axPos"`
  319. MajorGridlines *cChartLines `xml:"majorGridlines"`
  320. MinorGridlines *cChartLines `xml:"minorGridlines"`
  321. NumFmt *cNumFmt `xml:"numFmt"`
  322. MajorTickMark *attrValString `xml:"majorTickMark"`
  323. MinorTickMark *attrValString `xml:"minorTickMark"`
  324. TickLblPos *attrValString `xml:"tickLblPos"`
  325. SpPr *cSpPr `xml:"spPr"`
  326. TxPr *cTxPr `xml:"txPr"`
  327. CrossAx *attrValInt `xml:"crossAx"`
  328. Crosses *attrValString `xml:"crosses"`
  329. CrossBetween *attrValString `xml:"crossBetween"`
  330. MajorUnit *attrValFloat `xml:"majorUnit"`
  331. MinorUnit *attrValFloat `xml:"minorUnit"`
  332. Auto *attrValBool `xml:"auto"`
  333. LblAlgn *attrValString `xml:"lblAlgn"`
  334. LblOffset *attrValInt `xml:"lblOffset"`
  335. TickLblSkip *attrValInt `xml:"tickLblSkip"`
  336. TickMarkSkip *attrValInt `xml:"tickMarkSkip"`
  337. NoMultiLvlLbl *attrValBool `xml:"noMultiLvlLbl"`
  338. }
  339. // cChartLines directly maps the chart lines content model.
  340. type cChartLines struct {
  341. SpPr *cSpPr `xml:"spPr"`
  342. }
  343. // cScaling directly maps the scaling element. This element contains
  344. // additional axis settings.
  345. type cScaling struct {
  346. LogBase *attrValFloat `xml:"logBase"`
  347. Orientation *attrValString `xml:"orientation"`
  348. Max *attrValFloat `xml:"max"`
  349. Min *attrValFloat `xml:"min"`
  350. }
  351. // cNumFmt (Numbering Format) directly maps the numFmt element. This element
  352. // specifies number formatting for the parent element.
  353. type cNumFmt struct {
  354. FormatCode string `xml:"formatCode,attr"`
  355. SourceLinked bool `xml:"sourceLinked,attr"`
  356. }
  357. // cSer directly maps the ser element. This element specifies a series on a
  358. // chart.
  359. type cSer struct {
  360. IDx *attrValInt `xml:"idx"`
  361. Order *attrValInt `xml:"order"`
  362. Tx *cTx `xml:"tx"`
  363. SpPr *cSpPr `xml:"spPr"`
  364. DPt []*cDPt `xml:"dPt"`
  365. DLbls *cDLbls `xml:"dLbls"`
  366. Marker *cMarker `xml:"marker"`
  367. InvertIfNegative *attrValBool `xml:"invertIfNegative"`
  368. Cat *cCat `xml:"cat"`
  369. Val *cVal `xml:"val"`
  370. XVal *cCat `xml:"xVal"`
  371. YVal *cVal `xml:"yVal"`
  372. Smooth *attrValBool `xml:"smooth"`
  373. BubbleSize *cVal `xml:"bubbleSize"`
  374. Bubble3D *attrValBool `xml:"bubble3D"`
  375. }
  376. // cMarker (Marker) directly maps the marker element. This element specifies a
  377. // data marker.
  378. type cMarker struct {
  379. Symbol *attrValString `xml:"symbol"`
  380. Size *attrValInt `xml:"size"`
  381. SpPr *cSpPr `xml:"spPr"`
  382. }
  383. // cDPt (Data Point) directly maps the dPt element. This element specifies a
  384. // single data point.
  385. type cDPt struct {
  386. IDx *attrValInt `xml:"idx"`
  387. Bubble3D *attrValBool `xml:"bubble3D"`
  388. SpPr *cSpPr `xml:"spPr"`
  389. }
  390. // cCat (Category Axis Data) directly maps the cat element. This element
  391. // specifies the data used for the category axis.
  392. type cCat struct {
  393. StrRef *cStrRef `xml:"strRef"`
  394. }
  395. // cStrRef (String Reference) directly maps the strRef element. This element
  396. // specifies a reference to data for a single data label or title with a cache
  397. // of the last values used.
  398. type cStrRef struct {
  399. F string `xml:"f"`
  400. StrCache *cStrCache `xml:"strCache"`
  401. }
  402. // cStrCache (String Cache) directly maps the strCache element. This element
  403. // specifies the last string data used for a chart.
  404. type cStrCache struct {
  405. Pt []*cPt `xml:"pt"`
  406. PtCount *attrValInt `xml:"ptCount"`
  407. }
  408. // cPt directly maps the pt element. This element specifies data for a
  409. // particular data point.
  410. type cPt struct {
  411. IDx int `xml:"idx,attr"`
  412. V *string `xml:"v"`
  413. }
  414. // cVal directly maps the val element. This element specifies the data values
  415. // which shall be used to define the location of data markers on a chart.
  416. type cVal struct {
  417. NumRef *cNumRef `xml:"numRef"`
  418. }
  419. // cNumRef directly maps the numRef element. This element specifies a
  420. // reference to numeric data with a cache of the last values used.
  421. type cNumRef struct {
  422. F string `xml:"f"`
  423. NumCache *cNumCache `xml:"numCache"`
  424. }
  425. // cNumCache directly maps the numCache element. This element specifies the
  426. // last data shown on the chart for a series.
  427. type cNumCache struct {
  428. FormatCode string `xml:"formatCode"`
  429. Pt []*cPt `xml:"pt"`
  430. PtCount *attrValInt `xml:"ptCount"`
  431. }
  432. // cDLbls (Data Labels) directly maps the dLbls element. This element serves
  433. // as a root element that specifies the settings for the data labels for an
  434. // entire series or the entire chart. It contains child elements that specify
  435. // the specific formatting and positioning settings.
  436. type cDLbls struct {
  437. NumFmt *cNumFmt `xml:"numFmt"`
  438. ShowLegendKey *attrValBool `xml:"showLegendKey"`
  439. ShowVal *attrValBool `xml:"showVal"`
  440. ShowCatName *attrValBool `xml:"showCatName"`
  441. ShowSerName *attrValBool `xml:"showSerName"`
  442. ShowPercent *attrValBool `xml:"showPercent"`
  443. ShowBubbleSize *attrValBool `xml:"showBubbleSize"`
  444. ShowLeaderLines *attrValBool `xml:"showLeaderLines"`
  445. }
  446. // cLegend (Legend) directly maps the legend element. This element specifies
  447. // the legend.
  448. type cLegend struct {
  449. Layout *string `xml:"layout"`
  450. LegendPos *attrValString `xml:"legendPos"`
  451. Overlay *attrValBool `xml:"overlay"`
  452. SpPr *cSpPr `xml:"spPr"`
  453. TxPr *cTxPr `xml:"txPr"`
  454. }
  455. // cPrintSettings directly maps the printSettings element. This element
  456. // specifies the print settings for the chart.
  457. type cPrintSettings struct {
  458. HeaderFooter *string `xml:"headerFooter"`
  459. PageMargins *cPageMargins `xml:"pageMargins"`
  460. PageSetup *string `xml:"pageSetup"`
  461. }
  462. // cPageMargins directly maps the pageMargins element. This element specifies
  463. // the page margins for a chart.
  464. type cPageMargins struct {
  465. B float64 `xml:"b,attr"`
  466. Footer float64 `xml:"footer,attr"`
  467. Header float64 `xml:"header,attr"`
  468. L float64 `xml:"l,attr"`
  469. R float64 `xml:"r,attr"`
  470. T float64 `xml:"t,attr"`
  471. }
  472. // ChartNumFmt directly maps the number format settings of the chart.
  473. type ChartNumFmt struct {
  474. CustomNumFmt string
  475. SourceLinked bool
  476. }
  477. // ChartAxis directly maps the format settings of the chart axis.
  478. type ChartAxis struct {
  479. None bool
  480. MajorGridLines bool
  481. MinorGridLines bool
  482. MajorUnit float64
  483. TickLabelSkip int
  484. ReverseOrder bool
  485. Maximum *float64
  486. Minimum *float64
  487. Font Font
  488. LogBase float64
  489. NumFmt ChartNumFmt
  490. }
  491. // ChartDimension directly maps the dimension of the chart.
  492. type ChartDimension struct {
  493. Width uint
  494. Height uint
  495. }
  496. // ChartPlotArea directly maps the format settings of the plot area.
  497. type ChartPlotArea struct {
  498. SecondPlotValues int
  499. ShowBubbleSize bool
  500. ShowCatName bool
  501. ShowLeaderLines bool
  502. ShowPercent bool
  503. ShowSerName bool
  504. ShowVal bool
  505. NumFmt ChartNumFmt
  506. }
  507. // Chart directly maps the format settings of the chart.
  508. type Chart struct {
  509. Type ChartType
  510. Series []ChartSeries
  511. Format GraphicOptions
  512. Dimension ChartDimension
  513. Legend ChartLegend
  514. Title ChartTitle
  515. VaryColors *bool
  516. XAxis ChartAxis
  517. YAxis ChartAxis
  518. PlotArea ChartPlotArea
  519. ShowBlanksAs string
  520. HoleSize int
  521. order int
  522. }
  523. // ChartLegend directly maps the format settings of the chart legend.
  524. type ChartLegend struct {
  525. Position string
  526. ShowLegendKey bool
  527. }
  528. // ChartMarker directly maps the format settings of the chart marker.
  529. type ChartMarker struct {
  530. Symbol string
  531. Size int
  532. }
  533. // ChartLine directly maps the format settings of the chart line.
  534. type ChartLine struct {
  535. Smooth bool
  536. Width float64
  537. }
  538. // ChartSeries directly maps the format settings of the chart series.
  539. type ChartSeries struct {
  540. Name string
  541. Categories string
  542. Sizes string
  543. Values string
  544. Fill Fill
  545. Line ChartLine
  546. Marker ChartMarker
  547. }
  548. // ChartTitle directly maps the format settings of the chart title.
  549. type ChartTitle struct {
  550. Name string
  551. }