xmlChart.go 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. // Copyright 2016 - 2020 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
  6. // and read from XLSX / XLSM / XLTM files. Supports reading and writing
  7. // spreadsheet documents generated by Microsoft Exce™ 2007 and later. Supports
  8. // complex components by high compatibility, and provided streaming API for
  9. // generating or reading data from a worksheet with huge amounts of data. This
  10. // library needs Go version 1.10 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. XMLNSc string `xml:"xmlns:c,attr"`
  19. XMLNSa string `xml:"xmlns:a,attr"`
  20. XMLNSr string `xml:"xmlns:r,attr"`
  21. XMLNSc16r2 string `xml:"xmlns:c16r2,attr"`
  22. Date1904 *attrValBool `xml:"date1904"`
  23. Lang *attrValString `xml:"lang"`
  24. RoundedCorners *attrValBool `xml:"roundedCorners"`
  25. Chart cChart `xml:"chart"`
  26. SpPr *cSpPr `xml:"spPr"`
  27. TxPr *cTxPr `xml:"txPr"`
  28. PrintSettings *cPrintSettings `xml:"printSettings"`
  29. }
  30. // cThicknessSpPr directly maps the element that specifies the thickness of
  31. // the walls or floor as a percentage of the largest dimension of the plot
  32. // volume and SpPr element.
  33. type cThicknessSpPr struct {
  34. Thickness *attrValInt `xml:"thickness"`
  35. SpPr *cSpPr `xml:"spPr"`
  36. }
  37. // cChart (Chart) directly maps the chart element. This element specifies a
  38. // title.
  39. type cChart struct {
  40. Title *cTitle `xml:"title"`
  41. AutoTitleDeleted *cAutoTitleDeleted `xml:"autoTitleDeleted"`
  42. View3D *cView3D `xml:"view3D"`
  43. Floor *cThicknessSpPr `xml:"floor"`
  44. SideWall *cThicknessSpPr `xml:"sideWall"`
  45. BackWall *cThicknessSpPr `xml:"backWall"`
  46. PlotArea *cPlotArea `xml:"plotArea"`
  47. Legend *cLegend `xml:"legend"`
  48. PlotVisOnly *attrValBool `xml:"plotVisOnly"`
  49. DispBlanksAs *attrValString `xml:"dispBlanksAs"`
  50. ShowDLblsOverMax *attrValBool `xml:"showDLblsOverMax"`
  51. }
  52. // cTitle (Title) directly maps the title element. This element specifies a
  53. // title.
  54. type cTitle struct {
  55. Tx cTx `xml:"tx,omitempty"`
  56. Layout string `xml:"layout,omitempty"`
  57. Overlay *attrValBool `xml:"overlay"`
  58. SpPr cSpPr `xml:"spPr,omitempty"`
  59. TxPr cTxPr `xml:"txPr,omitempty"`
  60. }
  61. // cTx (Chart Text) directly maps the tx element. This element specifies text
  62. // to use on a chart, including rich text formatting.
  63. type cTx struct {
  64. StrRef *cStrRef `xml:"strRef"`
  65. Rich *cRich `xml:"rich,omitempty"`
  66. }
  67. // cRich (Rich Text) directly maps the rich element. This element contains a
  68. // string with rich text formatting.
  69. type cRich struct {
  70. BodyPr aBodyPr `xml:"a:bodyPr,omitempty"`
  71. LstStyle string `xml:"a:lstStyle,omitempty"`
  72. P aP `xml:"a:p"`
  73. }
  74. // aBodyPr (Body Properties) directly maps the a:bodyPr element. This element
  75. // defines the body properties for the text body within a shape.
  76. type aBodyPr struct {
  77. Anchor string `xml:"anchor,attr,omitempty"`
  78. AnchorCtr bool `xml:"anchorCtr,attr"`
  79. Rot int `xml:"rot,attr"`
  80. BIns float64 `xml:"bIns,attr,omitempty"`
  81. CompatLnSpc bool `xml:"compatLnSpc,attr,omitempty"`
  82. ForceAA bool `xml:"forceAA,attr,omitempty"`
  83. FromWordArt bool `xml:"fromWordArt,attr,omitempty"`
  84. HorzOverflow string `xml:"horzOverflow,attr,omitempty"`
  85. LIns float64 `xml:"lIns,attr,omitempty"`
  86. NumCol int `xml:"numCol,attr,omitempty"`
  87. RIns float64 `xml:"rIns,attr,omitempty"`
  88. RtlCol bool `xml:"rtlCol,attr,omitempty"`
  89. SpcCol int `xml:"spcCol,attr,omitempty"`
  90. SpcFirstLastPara bool `xml:"spcFirstLastPara,attr"`
  91. TIns float64 `xml:"tIns,attr,omitempty"`
  92. Upright bool `xml:"upright,attr,omitempty"`
  93. Vert string `xml:"vert,attr,omitempty"`
  94. VertOverflow string `xml:"vertOverflow,attr,omitempty"`
  95. Wrap string `xml:"wrap,attr,omitempty"`
  96. }
  97. // aP (Paragraph) directly maps the a:p element. This element specifies a
  98. // paragraph of content in the document.
  99. type aP struct {
  100. PPr *aPPr `xml:"a:pPr"`
  101. R *aR `xml:"a:r"`
  102. EndParaRPr *aEndParaRPr `xml:"a:endParaRPr"`
  103. }
  104. // aPPr (Paragraph Properties) directly maps the a:pPr element. This element
  105. // specifies a set of paragraph properties which shall be applied to the
  106. // contents of the parent paragraph after all style/numbering/table properties
  107. // have been applied to the text. These properties are defined as direct
  108. // formatting, since they are directly applied to the paragraph and supersede
  109. // any formatting from styles.
  110. type aPPr struct {
  111. DefRPr aRPr `xml:"a:defRPr"`
  112. }
  113. // aSolidFill (Solid Fill) directly maps the solidFill element. This element
  114. // specifies a solid color fill. The shape is filled entirely with the specified
  115. // color.
  116. type aSolidFill struct {
  117. SchemeClr *aSchemeClr `xml:"a:schemeClr"`
  118. SrgbClr *attrValString `xml:"a:srgbClr"`
  119. }
  120. // aSchemeClr (Scheme Color) directly maps the a:schemeClr element. This
  121. // element specifies a color bound to a user's theme. As with all elements which
  122. // define a color, it is possible to apply a list of color transforms to the
  123. // base color defined.
  124. type aSchemeClr struct {
  125. Val string `xml:"val,attr,omitempty"`
  126. LumMod *attrValInt `xml:"a:lumMod"`
  127. LumOff *attrValInt `xml:"a:lumOff"`
  128. }
  129. // attrValInt directly maps the val element with integer data type as an
  130. // attribute。
  131. type attrValInt struct {
  132. Val *int `xml:"val,attr"`
  133. }
  134. // attrValFloat directly maps the val element with float64 data type as an
  135. // attribute。
  136. type attrValFloat struct {
  137. Val *float64 `xml:"val,attr"`
  138. }
  139. // attrValBool directly maps the val element with boolean data type as an
  140. // attribute。
  141. type attrValBool struct {
  142. Val *bool `xml:"val,attr"`
  143. }
  144. // attrValString directly maps the val element with string data type as an
  145. // attribute。
  146. type attrValString struct {
  147. Val *string `xml:"val,attr"`
  148. }
  149. // aCs directly maps the a:cs element.
  150. type aCs struct {
  151. Typeface string `xml:"typeface,attr"`
  152. }
  153. // aEa directly maps the a:ea element.
  154. type aEa struct {
  155. Typeface string `xml:"typeface,attr"`
  156. }
  157. // aLatin (Latin Font) directly maps the a:latin element. This element
  158. // specifies that a Latin font be used for a specific run of text. This font is
  159. // specified with a typeface attribute much like the others but is specifically
  160. // classified as a Latin font.
  161. type aLatin struct {
  162. Typeface string `xml:"typeface,attr"`
  163. }
  164. // aR directly maps the a:r element.
  165. type aR struct {
  166. RPr aRPr `xml:"a:rPr,omitempty"`
  167. T string `xml:"a:t,omitempty"`
  168. }
  169. // aRPr (Run Properties) directly maps the rPr element. This element
  170. // specifies a set of run properties which shall be applied to the contents of
  171. // the parent run after all style formatting has been applied to the text. These
  172. // properties are defined as direct formatting, since they are directly applied
  173. // to the run and supersede any formatting from styles.
  174. type aRPr struct {
  175. AltLang string `xml:"altLang,attr,omitempty"`
  176. B bool `xml:"b,attr"`
  177. Baseline int `xml:"baseline,attr"`
  178. Bmk string `xml:"bmk,attr,omitempty"`
  179. Cap string `xml:"cap,attr,omitempty"`
  180. Dirty bool `xml:"dirty,attr,omitempty"`
  181. Err bool `xml:"err,attr,omitempty"`
  182. I bool `xml:"i,attr"`
  183. Kern int `xml:"kern,attr"`
  184. Kumimoji bool `xml:"kumimoji,attr,omitempty"`
  185. Lang string `xml:"lang,attr,omitempty"`
  186. NoProof bool `xml:"noProof,attr,omitempty"`
  187. NormalizeH bool `xml:"normalizeH,attr,omitempty"`
  188. SmtClean bool `xml:"smtClean,attr,omitempty"`
  189. SmtID uint64 `xml:"smtId,attr,omitempty"`
  190. Spc int `xml:"spc,attr"`
  191. Strike string `xml:"strike,attr,omitempty"`
  192. Sz float64 `xml:"sz,attr,omitempty"`
  193. U string `xml:"u,attr,omitempty"`
  194. SolidFill *aSolidFill `xml:"a:solidFill"`
  195. Latin *aLatin `xml:"a:latin"`
  196. Ea *aEa `xml:"a:ea"`
  197. Cs *aCs `xml:"a:cs"`
  198. }
  199. // cSpPr (Shape Properties) directly maps the spPr element. This element
  200. // specifies the visual shape properties that can be applied to a shape. These
  201. // properties include the shape fill, outline, geometry, effects, and 3D
  202. // orientation.
  203. type cSpPr struct {
  204. NoFill *string `xml:"a:noFill"`
  205. SolidFill *aSolidFill `xml:"a:solidFill"`
  206. Ln *aLn `xml:"a:ln"`
  207. Sp3D *aSp3D `xml:"a:sp3d"`
  208. EffectLst *string `xml:"a:effectLst"`
  209. }
  210. // aSp3D (3-D Shape Properties) directly maps the a:sp3d element. This element
  211. // defines the 3D properties associated with a particular shape in DrawingML.
  212. // The 3D properties which can be applied to a shape are top and bottom bevels,
  213. // a contour and an extrusion.
  214. type aSp3D struct {
  215. ContourW int `xml:"contourW,attr"`
  216. ContourClr *aContourClr `xml:"a:contourClr"`
  217. }
  218. // aContourClr (Contour Color) directly maps the a:contourClr element. This
  219. // element defines the color for the contour on a shape. The contour of a shape
  220. // is a solid filled line which surrounds the outer edges of the shape.
  221. type aContourClr struct {
  222. SchemeClr *aSchemeClr `xml:"a:schemeClr"`
  223. }
  224. // aLn (Outline) directly maps the a:ln element. This element specifies an
  225. // outline style that can be applied to a number of different objects such as
  226. // shapes and text. The line allows for the specifying of many different types
  227. // of outlines including even line dashes and bevels.
  228. type aLn struct {
  229. Algn string `xml:"algn,attr,omitempty"`
  230. Cap string `xml:"cap,attr,omitempty"`
  231. Cmpd string `xml:"cmpd,attr,omitempty"`
  232. W int `xml:"w,attr,omitempty"`
  233. NoFill string `xml:"a:noFill,omitempty"`
  234. Round string `xml:"a:round,omitempty"`
  235. SolidFill *aSolidFill `xml:"a:solidFill"`
  236. }
  237. // cTxPr (Text Properties) directly maps the txPr element. This element
  238. // specifies text formatting. The lstStyle element is not supported.
  239. type cTxPr struct {
  240. BodyPr aBodyPr `xml:"a:bodyPr,omitempty"`
  241. LstStyle string `xml:"a:lstStyle,omitempty"`
  242. P aP `xml:"a:p,omitempty"`
  243. }
  244. // aEndParaRPr (End Paragraph Run Properties) directly maps the a:endParaRPr
  245. // element. This element specifies the text run properties that are to be used
  246. // if another run is inserted after the last run specified. This effectively
  247. // saves the run property state so that it can be applied when the user enters
  248. // additional text. If this element is omitted, then the application can
  249. // determine which default properties to apply. It is recommended that this
  250. // element be specified at the end of the list of text runs within the paragraph
  251. // so that an orderly list is maintained.
  252. type aEndParaRPr struct {
  253. Lang string `xml:"lang,attr"`
  254. AltLang string `xml:"altLang,attr,omitempty"`
  255. Sz int `xml:"sz,attr,omitempty"`
  256. }
  257. // cAutoTitleDeleted (Auto Title Is Deleted) directly maps the
  258. // autoTitleDeleted element. This element specifies the title shall not be
  259. // shown for this chart.
  260. type cAutoTitleDeleted struct {
  261. Val bool `xml:"val,attr"`
  262. }
  263. // cView3D (View In 3D) directly maps the view3D element. This element
  264. // specifies the 3-D view of the chart.
  265. type cView3D struct {
  266. RotX *attrValInt `xml:"rotX"`
  267. RotY *attrValInt `xml:"rotY"`
  268. RAngAx *attrValInt `xml:"rAngAx"`
  269. DepthPercent *attrValInt `xml:"depthPercent"`
  270. Perspective *attrValInt `xml:"perspective"`
  271. ExtLst *xlsxExtLst `xml:"extLst"`
  272. }
  273. // cPlotArea directly maps the plotArea element. This element specifies the
  274. // plot area of the chart.
  275. type cPlotArea struct {
  276. Layout *string `xml:"layout"`
  277. AreaChart *cCharts `xml:"areaChart"`
  278. Area3DChart *cCharts `xml:"area3DChart"`
  279. BarChart *cCharts `xml:"barChart"`
  280. Bar3DChart *cCharts `xml:"bar3DChart"`
  281. BubbleChart *cCharts `xml:"bubbleChart"`
  282. DoughnutChart *cCharts `xml:"doughnutChart"`
  283. LineChart *cCharts `xml:"lineChart"`
  284. PieChart *cCharts `xml:"pieChart"`
  285. Pie3DChart *cCharts `xml:"pie3DChart"`
  286. OfPieChart *cCharts `xml:"ofPieChart"`
  287. RadarChart *cCharts `xml:"radarChart"`
  288. ScatterChart *cCharts `xml:"scatterChart"`
  289. Surface3DChart *cCharts `xml:"surface3DChart"`
  290. SurfaceChart *cCharts `xml:"surfaceChart"`
  291. CatAx []*cAxs `xml:"catAx"`
  292. ValAx []*cAxs `xml:"valAx"`
  293. SerAx []*cAxs `xml:"serAx"`
  294. SpPr *cSpPr `xml:"spPr"`
  295. }
  296. // cCharts specifies the common element of the chart.
  297. type cCharts struct {
  298. BarDir *attrValString `xml:"barDir"`
  299. BubbleScale *attrValFloat `xml:"bubbleScale"`
  300. Grouping *attrValString `xml:"grouping"`
  301. RadarStyle *attrValString `xml:"radarStyle"`
  302. ScatterStyle *attrValString `xml:"scatterStyle"`
  303. OfPieType *attrValString `xml:"ofPieType"`
  304. VaryColors *attrValBool `xml:"varyColors"`
  305. Wireframe *attrValBool `xml:"wireframe"`
  306. Ser *[]cSer `xml:"ser"`
  307. SerLines *attrValString `xml:"serLines"`
  308. DLbls *cDLbls `xml:"dLbls"`
  309. Shape *attrValString `xml:"shape"`
  310. HoleSize *attrValInt `xml:"holeSize"`
  311. Smooth *attrValBool `xml:"smooth"`
  312. Overlap *attrValInt `xml:"overlap"`
  313. AxID []*attrValInt `xml:"axId"`
  314. }
  315. // cAxs directly maps the catAx and valAx element.
  316. type cAxs struct {
  317. AxID *attrValInt `xml:"axId"`
  318. Scaling *cScaling `xml:"scaling"`
  319. Delete *attrValBool `xml:"delete"`
  320. AxPos *attrValString `xml:"axPos"`
  321. MajorGridlines *cChartLines `xml:"majorGridlines"`
  322. MinorGridlines *cChartLines `xml:"minorGridlines"`
  323. NumFmt *cNumFmt `xml:"numFmt"`
  324. MajorTickMark *attrValString `xml:"majorTickMark"`
  325. MinorTickMark *attrValString `xml:"minorTickMark"`
  326. TickLblPos *attrValString `xml:"tickLblPos"`
  327. SpPr *cSpPr `xml:"spPr"`
  328. TxPr *cTxPr `xml:"txPr"`
  329. CrossAx *attrValInt `xml:"crossAx"`
  330. Crosses *attrValString `xml:"crosses"`
  331. CrossBetween *attrValString `xml:"crossBetween"`
  332. MajorUnit *attrValFloat `xml:"majorUnit"`
  333. MinorUnit *attrValFloat `xml:"minorUnit"`
  334. Auto *attrValBool `xml:"auto"`
  335. LblAlgn *attrValString `xml:"lblAlgn"`
  336. LblOffset *attrValInt `xml:"lblOffset"`
  337. TickLblSkip *attrValInt `xml:"tickLblSkip"`
  338. TickMarkSkip *attrValInt `xml:"tickMarkSkip"`
  339. NoMultiLvlLbl *attrValBool `xml:"noMultiLvlLbl"`
  340. }
  341. // cChartLines directly maps the chart lines content model.
  342. type cChartLines struct {
  343. SpPr *cSpPr `xml:"spPr"`
  344. }
  345. // cScaling directly maps the scaling element. This element contains
  346. // additional axis settings.
  347. type cScaling struct {
  348. Orientation *attrValString `xml:"orientation"`
  349. Max *attrValFloat `xml:"max"`
  350. Min *attrValFloat `xml:"min"`
  351. }
  352. // cNumFmt (Numbering Format) directly maps the numFmt element. This element
  353. // specifies number formatting for the parent element.
  354. type cNumFmt struct {
  355. FormatCode string `xml:"formatCode,attr"`
  356. SourceLinked bool `xml:"sourceLinked,attr"`
  357. }
  358. // cSer directly maps the ser element. This element specifies a series on a
  359. // chart.
  360. type cSer struct {
  361. IDx *attrValInt `xml:"idx"`
  362. Order *attrValInt `xml:"order"`
  363. Tx *cTx `xml:"tx"`
  364. SpPr *cSpPr `xml:"spPr"`
  365. DPt []*cDPt `xml:"dPt"`
  366. DLbls *cDLbls `xml:"dLbls"`
  367. Marker *cMarker `xml:"marker"`
  368. InvertIfNegative *attrValBool `xml:"invertIfNegative"`
  369. Cat *cCat `xml:"cat"`
  370. Val *cVal `xml:"val"`
  371. XVal *cCat `xml:"xVal"`
  372. YVal *cVal `xml:"yVal"`
  373. Smooth *attrValBool `xml:"smooth"`
  374. BubbleSize *cVal `xml:"bubbleSize"`
  375. Bubble3D *attrValBool `xml:"bubble3D"`
  376. }
  377. // cMarker (Marker) directly maps the marker element. This element specifies a
  378. // data marker.
  379. type cMarker struct {
  380. Symbol *attrValString `xml:"symbol"`
  381. Size *attrValInt `xml:"size"`
  382. SpPr *cSpPr `xml:"spPr"`
  383. }
  384. // cDPt (Data Point) directly maps the dPt element. This element specifies a
  385. // single data point.
  386. type cDPt struct {
  387. IDx *attrValInt `xml:"idx"`
  388. Bubble3D *attrValBool `xml:"bubble3D"`
  389. SpPr *cSpPr `xml:"spPr"`
  390. }
  391. // cCat (Category Axis Data) directly maps the cat element. This element
  392. // specifies the data used for the category axis.
  393. type cCat struct {
  394. StrRef *cStrRef `xml:"strRef"`
  395. }
  396. // cStrRef (String Reference) directly maps the strRef element. This element
  397. // specifies a reference to data for a single data label or title with a cache
  398. // of the last values used.
  399. type cStrRef struct {
  400. F string `xml:"f"`
  401. StrCache *cStrCache `xml:"strCache"`
  402. }
  403. // cStrCache (String Cache) directly maps the strCache element. This element
  404. // specifies the last string data used for a chart.
  405. type cStrCache struct {
  406. Pt []*cPt `xml:"pt"`
  407. PtCount *attrValInt `xml:"ptCount"`
  408. }
  409. // cPt directly maps the pt element. This element specifies data for a
  410. // particular data point.
  411. type cPt struct {
  412. IDx int `xml:"idx,attr"`
  413. V *string `xml:"v"`
  414. }
  415. // cVal directly maps the val element. This element specifies the data values
  416. // which shall be used to define the location of data markers on a chart.
  417. type cVal struct {
  418. NumRef *cNumRef `xml:"numRef"`
  419. }
  420. // cNumRef directly maps the numRef element. This element specifies a
  421. // reference to numeric data with a cache of the last values used.
  422. type cNumRef struct {
  423. F string `xml:"f"`
  424. NumCache *cNumCache `xml:"numCache"`
  425. }
  426. // cNumCache directly maps the numCache element. This element specifies the
  427. // last data shown on the chart for a series.
  428. type cNumCache struct {
  429. FormatCode string `xml:"formatCode"`
  430. Pt []*cPt `xml:"pt"`
  431. PtCount *attrValInt `xml:"ptCount"`
  432. }
  433. // cDLbls (Data Lables) directly maps the dLbls element. This element serves
  434. // as a root element that specifies the settings for the data labels for an
  435. // entire series or the entire chart. It contains child elements that specify
  436. // the specific formatting and positioning settings.
  437. type cDLbls struct {
  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. // formatChartAxis directly maps the format settings of the chart axis.
  473. type formatChartAxis struct {
  474. Crossing string `json:"crossing"`
  475. MajorGridlines bool `json:"major_grid_lines"`
  476. MinorGridlines bool `json:"minor_grid_lines"`
  477. MajorTickMark string `json:"major_tick_mark"`
  478. MinorTickMark string `json:"minor_tick_mark"`
  479. MinorUnitType string `json:"minor_unit_type"`
  480. MajorUnit float64 `json:"major_unit"`
  481. MajorUnitType string `json:"major_unit_type"`
  482. TickLabelSkip int `json:"tick_label_skip"`
  483. DisplayUnits string `json:"display_units"`
  484. DisplayUnitsVisible bool `json:"display_units_visible"`
  485. DateAxis bool `json:"date_axis"`
  486. ReverseOrder bool `json:"reverse_order"`
  487. Maximum float64 `json:"maximum"`
  488. Minimum float64 `json:"minimum"`
  489. NumFormat string `json:"num_format"`
  490. NumFont struct {
  491. Color string `json:"color"`
  492. Bold bool `json:"bold"`
  493. Italic bool `json:"italic"`
  494. Underline bool `json:"underline"`
  495. } `json:"num_font"`
  496. NameLayout formatLayout `json:"name_layout"`
  497. }
  498. type formatChartDimension struct {
  499. Width int `json:"width"`
  500. Height int `json:"height"`
  501. }
  502. // formatChart directly maps the format settings of the chart.
  503. type formatChart struct {
  504. Type string `json:"type"`
  505. Series []formatChartSeries `json:"series"`
  506. Format formatPicture `json:"format"`
  507. Dimension formatChartDimension `json:"dimension"`
  508. Legend formatChartLegend `json:"legend"`
  509. Title formatChartTitle `json:"title"`
  510. XAxis formatChartAxis `json:"x_axis"`
  511. YAxis formatChartAxis `json:"y_axis"`
  512. Chartarea struct {
  513. Border struct {
  514. None bool `json:"none"`
  515. } `json:"border"`
  516. Fill struct {
  517. Color string `json:"color"`
  518. } `json:"fill"`
  519. Pattern struct {
  520. Pattern string `json:"pattern"`
  521. FgColor string `json:"fg_color"`
  522. BgColor string `json:"bg_color"`
  523. } `json:"pattern"`
  524. } `json:"chartarea"`
  525. Plotarea struct {
  526. ShowBubbleSize bool `json:"show_bubble_size"`
  527. ShowCatName bool `json:"show_cat_name"`
  528. ShowLeaderLines bool `json:"show_leader_lines"`
  529. ShowPercent bool `json:"show_percent"`
  530. ShowSerName bool `json:"show_series_name"`
  531. ShowVal bool `json:"show_val"`
  532. Gradient struct {
  533. Colors []string `json:"colors"`
  534. } `json:"gradient"`
  535. Border struct {
  536. Color string `json:"color"`
  537. Width int `json:"width"`
  538. DashType string `json:"dash_type"`
  539. } `json:"border"`
  540. Fill struct {
  541. Color string `json:"color"`
  542. } `json:"fill"`
  543. Layout formatLayout `json:"layout"`
  544. } `json:"plotarea"`
  545. ShowBlanksAs string `json:"show_blanks_as"`
  546. ShowHiddenData bool `json:"show_hidden_data"`
  547. SetRotation int `json:"set_rotation"`
  548. SetHoleSize int `json:"set_hole_size"`
  549. order int
  550. }
  551. // formatChartLegend directly maps the format settings of the chart legend.
  552. type formatChartLegend struct {
  553. None bool `json:"none"`
  554. DeleteSeries []int `json:"delete_series"`
  555. Font Font `json:"font"`
  556. Layout formatLayout `json:"layout"`
  557. Position string `json:"position"`
  558. ShowLegendEntry bool `json:"show_legend_entry"`
  559. ShowLegendKey bool `json:"show_legend_key"`
  560. }
  561. // formatChartSeries directly maps the format settings of the chart series.
  562. type formatChartSeries struct {
  563. Name string `json:"name"`
  564. Categories string `json:"categories"`
  565. Values string `json:"values"`
  566. Line struct {
  567. None bool `json:"none"`
  568. Color string `json:"color"`
  569. Width float64 `json:"width"`
  570. } `json:"line"`
  571. Marker struct {
  572. Type string `json:"type"`
  573. Size int `json:"size"`
  574. Width float64 `json:"width"`
  575. Border struct {
  576. Color string `json:"color"`
  577. None bool `json:"none"`
  578. } `json:"border"`
  579. Fill struct {
  580. Color string `json:"color"`
  581. None bool `json:"none"`
  582. } `json:"fill"`
  583. } `json:"marker"`
  584. }
  585. // formatChartTitle directly maps the format settings of the chart title.
  586. type formatChartTitle struct {
  587. None bool `json:"none"`
  588. Name string `json:"name"`
  589. Overlay bool `json:"overlay"`
  590. Layout formatLayout `json:"layout"`
  591. }
  592. // formatLayout directly maps the format settings of the element layout.
  593. type formatLayout struct {
  594. X float64 `json:"x"`
  595. Y float64 `json:"y"`
  596. Width float64 `json:"width"`
  597. Height float64 `json:"height"`
  598. }