xmlChart.go 23 KB

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