xmlChart.go 23 KB

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