xmlChart.go 23 KB

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