xmlChart.go 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  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 aRPr `xml:"a:defRPr"`
  102. }
  103. // aSolidFill (Solid Fill) directly maps the solidFill element. This element
  104. // specifies a solid color fill. The shape is filled entirely with the specified
  105. // color.
  106. type aSolidFill struct {
  107. SchemeClr *aSchemeClr `xml:"a:schemeClr"`
  108. SrgbClr *attrValString `xml:"a:srgbClr"`
  109. }
  110. // aSchemeClr (Scheme Color) directly maps the a:schemeClr element. This
  111. // element specifies a color bound to a user's theme. As with all elements which
  112. // define a color, it is possible to apply a list of color transforms to the
  113. // base color defined.
  114. type aSchemeClr struct {
  115. Val string `xml:"val,attr,omitempty"`
  116. LumMod *attrValInt `xml:"a:lumMod"`
  117. LumOff *attrValInt `xml:"a:lumOff"`
  118. }
  119. // attrValInt directly maps the val element with integer data type as an
  120. // attribute。
  121. type attrValInt struct {
  122. Val int `xml:"val,attr"`
  123. }
  124. // attrValFloat directly maps the val element with float64 data type as an
  125. // attribute。
  126. type attrValFloat struct {
  127. Val float64 `xml:"val,attr"`
  128. }
  129. // attrValBool directly maps the val element with boolean data type as an
  130. // attribute。
  131. type attrValBool struct {
  132. Val bool `xml:"val,attr"`
  133. }
  134. // attrValString directly maps the val element with string data type as an
  135. // attribute。
  136. type attrValString struct {
  137. Val string `xml:"val,attr"`
  138. }
  139. // aCs directly maps the a:cs element.
  140. type aCs struct {
  141. Typeface string `xml:"typeface,attr"`
  142. }
  143. // aEa directly maps the a:ea element.
  144. type aEa struct {
  145. Typeface string `xml:"typeface,attr"`
  146. }
  147. // aLatin (Latin Font) directly maps the a:latin element. This element
  148. // specifies that a Latin font be used for a specific run of text. This font is
  149. // specified with a typeface attribute much like the others but is specifically
  150. // classified as a Latin font.
  151. type aLatin struct {
  152. Typeface string `xml:"typeface,attr"`
  153. }
  154. // aR directly maps the a:r element.
  155. type aR struct {
  156. RPr aRPr `xml:"a:rPr,omitempty"`
  157. T string `xml:"a:t,omitempty"`
  158. }
  159. // aRPr (Run Properties) directly maps the c:rPr element. This element
  160. // specifies a set of run properties which shall be applied to the contents of
  161. // the parent run after all style formatting has been applied to the text. These
  162. // properties are defined as direct formatting, since they are directly applied
  163. // to the run and supersede any formatting from styles.
  164. type aRPr struct {
  165. AltLang string `xml:"altLang,attr,omitempty"`
  166. B bool `xml:"b,attr"`
  167. Baseline int `xml:"baseline,attr"`
  168. Bmk string `xml:"bmk,attr,omitempty"`
  169. Cap string `xml:"cap,attr,omitempty"`
  170. Dirty bool `xml:"dirty,attr,omitempty"`
  171. Err bool `xml:"err,attr,omitempty"`
  172. I bool `xml:"i,attr"`
  173. Kern int `xml:"kern,attr"`
  174. Kumimoji bool `xml:"kumimoji,attr,omitempty"`
  175. Lang string `xml:"lang,attr,omitempty"`
  176. NoProof bool `xml:"noProof,attr,omitempty"`
  177. NormalizeH bool `xml:"normalizeH,attr,omitempty"`
  178. SmtClean bool `xml:"smtClean,attr,omitempty"`
  179. SmtID uint64 `xml:"smtId,attr,omitempty"`
  180. Spc int `xml:"spc,attr"`
  181. Strike string `xml:"strike,attr,omitempty"`
  182. Sz int `xml:"sz,attr,omitempty"`
  183. U string `xml:"u,attr,omitempty"`
  184. SolidFill *aSolidFill `xml:"a:solidFill"`
  185. Latin *aLatin `xml:"a:latin"`
  186. Ea *aEa `xml:"a:ea"`
  187. Cs *aCs `xml:"a:cs"`
  188. }
  189. // cSpPr (Shape Properties) directly maps the c:spPr element. This element
  190. // specifies the visual shape properties that can be applied to a shape. These
  191. // properties include the shape fill, outline, geometry, effects, and 3D
  192. // orientation.
  193. type cSpPr struct {
  194. NoFill *string `xml:"a:noFill"`
  195. SolidFill *aSolidFill `xml:"a:solidFill"`
  196. Ln *aLn `xml:"a:ln"`
  197. Sp3D *aSp3D `xml:"a:sp3d"`
  198. EffectLst *string `xml:"a:effectLst"`
  199. }
  200. // aSp3D (3-D Shape Properties) directly maps the a:sp3d element. This element
  201. // defines the 3D properties associated with a particular shape in DrawingML.
  202. // The 3D properties which can be applied to a shape are top and bottom bevels,
  203. // a contour and an extrusion.
  204. type aSp3D struct {
  205. ContourW int `xml:"contourW,attr"`
  206. ContourClr *aContourClr `xml:"a:contourClr"`
  207. }
  208. // aContourClr (Contour Color) directly maps the a:contourClr element. This
  209. // element defines the color for the contour on a shape. The contour of a shape
  210. // is a solid filled line which surrounds the outer edges of the shape.
  211. type aContourClr struct {
  212. SchemeClr *aSchemeClr `xml:"a:schemeClr"`
  213. }
  214. // aLn (Outline) directly maps the a:ln element. This element specifies an
  215. // outline style that can be applied to a number of different objects such as
  216. // shapes and text. The line allows for the specifying of many different types
  217. // of outlines including even line dashes and bevels.
  218. type aLn struct {
  219. Algn string `xml:"algn,attr,omitempty"`
  220. Cap string `xml:"cap,attr,omitempty"`
  221. Cmpd string `xml:"cmpd,attr,omitempty"`
  222. W int `xml:"w,attr,omitempty" `
  223. NoFill string `xml:"a:noFill,omitempty"`
  224. Round string `xml:"a:round,omitempty"`
  225. SolidFill *aSolidFill `xml:"a:solidFill"`
  226. }
  227. // cTxPr (Text Properties) directly maps the c:txPr element. This element
  228. // specifies text formatting. The lstStyle element is not supported.
  229. type cTxPr struct {
  230. BodyPr aBodyPr `xml:"a:bodyPr,omitempty"`
  231. LstStyle string `xml:"a:lstStyle,omitempty"`
  232. P aP `xml:"a:p,omitempty"`
  233. }
  234. // aEndParaRPr (End Paragraph Run Properties) directly maps the a:endParaRPr
  235. // element. This element specifies the text run properties that are to be used
  236. // if another run is inserted after the last run specified. This effectively
  237. // saves the run property state so that it can be applied when the user enters
  238. // additional text. If this element is omitted, then the application can
  239. // determine which default properties to apply. It is recommended that this
  240. // element be specified at the end of the list of text runs within the paragraph
  241. // so that an orderly list is maintained.
  242. type aEndParaRPr struct {
  243. Lang string `xml:"lang,attr"`
  244. AltLang string `xml:"altLang,attr,omitempty"`
  245. Sz int `xml:"sz,attr,omitempty"`
  246. }
  247. // cAutoTitleDeleted (Auto Title Is Deleted) directly maps the
  248. // c:autoTitleDeleted element. This element specifies the title shall not be
  249. // shown for this chart.
  250. type cAutoTitleDeleted struct {
  251. Val bool `xml:"val,attr"`
  252. }
  253. // cView3D (View In 3D) directly maps the c:view3D element. This element
  254. // specifies the 3-D view of the chart.
  255. type cView3D struct {
  256. RotX *attrValInt `xml:"c:rotX"`
  257. RotY *attrValInt `xml:"c:rotY"`
  258. DepthPercent *attrValInt `xml:"c:depthPercent"`
  259. RAngAx *attrValInt `xml:"c:rAngAx"`
  260. }
  261. // cPlotArea directly maps the c:plotArea element. This element specifies the
  262. // plot area of the chart.
  263. type cPlotArea struct {
  264. Layout *string `xml:"c:layout"`
  265. BarChart *cCharts `xml:"c:barChart"`
  266. Bar3DChart *cCharts `xml:"c:bar3DChart"`
  267. DoughnutChart *cCharts `xml:"c:doughnutChart"`
  268. LineChart *cCharts `xml:"c:lineChart"`
  269. PieChart *cCharts `xml:"c:pieChart"`
  270. Pie3DChart *cCharts `xml:"c:pie3DChart"`
  271. RadarChart *cCharts `xml:"c:radarChart"`
  272. ScatterChart *cCharts `xml:"c:scatterChart"`
  273. CatAx []*cAxs `xml:"c:catAx"`
  274. ValAx []*cAxs `xml:"c:valAx"`
  275. SpPr *cSpPr `xml:"c:spPr"`
  276. }
  277. // cCharts specifies the common element of the chart.
  278. type cCharts struct {
  279. BarDir *attrValString `xml:"c:barDir"`
  280. Grouping *attrValString `xml:"c:grouping"`
  281. RadarStyle *attrValString `xml:"c:radarStyle"`
  282. ScatterStyle *attrValString `xml:"c:scatterStyle"`
  283. VaryColors *attrValBool `xml:"c:varyColors"`
  284. Ser *[]cSer `xml:"c:ser"`
  285. DLbls *cDLbls `xml:"c:dLbls"`
  286. HoleSize *attrValInt `xml:"c:holeSize"`
  287. Smooth *attrValBool `xml:"c:smooth"`
  288. Overlap *attrValInt `xml:"c:overlap"`
  289. AxID []*attrValInt `xml:"c:axId"`
  290. }
  291. // cAxs directly maps the c:catAx and c:valAx element.
  292. type cAxs struct {
  293. AxID *attrValInt `xml:"c:axId"`
  294. Scaling *cScaling `xml:"c:scaling"`
  295. Delete *attrValBool `xml:"c:delete"`
  296. AxPos *attrValString `xml:"c:axPos"`
  297. NumFmt *cNumFmt `xml:"c:numFmt"`
  298. MajorTickMark *attrValString `xml:"c:majorTickMark"`
  299. MinorTickMark *attrValString `xml:"c:minorTickMark"`
  300. TickLblPos *attrValString `xml:"c:tickLblPos"`
  301. SpPr *cSpPr `xml:"c:spPr"`
  302. TxPr *cTxPr `xml:"c:txPr"`
  303. CrossAx *attrValInt `xml:"c:crossAx"`
  304. Crosses *attrValString `xml:"c:crosses"`
  305. CrossBetween *attrValString `xml:"c:crossBetween"`
  306. Auto *attrValBool `xml:"c:auto"`
  307. LblAlgn *attrValString `xml:"c:lblAlgn"`
  308. LblOffset *attrValInt `xml:"c:lblOffset"`
  309. NoMultiLvlLbl *attrValBool `xml:"c:noMultiLvlLbl"`
  310. }
  311. // cScaling directly maps the c:scaling element. This element contains
  312. // additional axis settings.
  313. type cScaling struct {
  314. Orientation *attrValString `xml:"c:orientation"`
  315. Max *attrValFloat `xml:"c:max"`
  316. Min *attrValFloat `xml:"c:min"`
  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. // formatChartAxis directly maps the format settings of the chart axis.
  437. type formatChartAxis struct {
  438. Crossing string `json:"crossing"`
  439. MajorTickMark string `json:"major_tick_mark"`
  440. MinorTickMark string `json:"minor_tick_mark"`
  441. MinorUnitType string `json:"minor_unit_type"`
  442. MajorUnit int `json:"major_unit"`
  443. MajorUnitType string `json:"major_unit_type"`
  444. DisplayUnits string `json:"display_units"`
  445. DisplayUnitsVisible bool `json:"display_units_visible"`
  446. DateAxis bool `json:"date_axis"`
  447. ReverseOrder bool `json:"reverse_order"`
  448. Maximum float64 `json:"maximum"`
  449. Minimum float64 `json:"minimum"`
  450. NumFormat string `json:"num_format"`
  451. NumFont struct {
  452. Color string `json:"color"`
  453. Bold bool `json:"bold"`
  454. Italic bool `json:"italic"`
  455. Underline bool `json:"underline"`
  456. } `json:"num_font"`
  457. NameLayout formatLayout `json:"name_layout"`
  458. }
  459. type formatChartDimension struct {
  460. Width int `json:"width"`
  461. Height int `json:"height"`
  462. }
  463. // formatChart directly maps the format settings of the chart.
  464. type formatChart struct {
  465. Type string `json:"type"`
  466. Series []formatChartSeries `json:"series"`
  467. Format formatPicture `json:"format"`
  468. Dimension formatChartDimension `json:"dimension"`
  469. Legend formatChartLegend `json:"legend"`
  470. Title formatChartTitle `json:"title"`
  471. XAxis formatChartAxis `json:"x_axis"`
  472. YAxis formatChartAxis `json:"y_axis"`
  473. Chartarea struct {
  474. Border struct {
  475. None bool `json:"none"`
  476. } `json:"border"`
  477. Fill struct {
  478. Color string `json:"color"`
  479. } `json:"fill"`
  480. Pattern struct {
  481. Pattern string `json:"pattern"`
  482. FgColor string `json:"fg_color"`
  483. BgColor string `json:"bg_color"`
  484. } `json:"pattern"`
  485. } `json:"chartarea"`
  486. Plotarea struct {
  487. ShowBubbleSize bool `json:"show_bubble_size"`
  488. ShowCatName bool `json:"show_cat_name"`
  489. ShowLeaderLines bool `json:"show_leader_lines"`
  490. ShowPercent bool `json:"show_percent"`
  491. ShowSerName bool `json:"show_series_name"`
  492. ShowVal bool `json:"show_val"`
  493. Gradient struct {
  494. Colors []string `json:"colors"`
  495. } `json:"gradient"`
  496. Border struct {
  497. Color string `json:"color"`
  498. Width int `json:"width"`
  499. DashType string `json:"dash_type"`
  500. } `json:"border"`
  501. Fill struct {
  502. Color string `json:"color"`
  503. } `json:"fill"`
  504. Layout formatLayout `json:"layout"`
  505. } `json:"plotarea"`
  506. ShowBlanksAs string `json:"show_blanks_as"`
  507. ShowHiddenData bool `json:"show_hidden_data"`
  508. SetRotation int `json:"set_rotation"`
  509. SetHoleSize int `json:"set_hole_size"`
  510. }
  511. // formatChartLegend directly maps the format settings of the chart legend.
  512. type formatChartLegend struct {
  513. None bool `json:"none"`
  514. DeleteSeries []int `json:"delete_series"`
  515. Font formatFont `json:"font"`
  516. Layout formatLayout `json:"layout"`
  517. Position string `json:"position"`
  518. ShowLegendEntry bool `json:"show_legend_entry"`
  519. ShowLegendKey bool `json:"show_legend_key"`
  520. }
  521. // formatChartSeries directly maps the format settings of the chart series.
  522. type formatChartSeries struct {
  523. Name string `json:"name"`
  524. Categories string `json:"categories"`
  525. Values string `json:"values"`
  526. Line struct {
  527. None bool `json:"none"`
  528. Color string `json:"color"`
  529. } `json:"line"`
  530. Marker struct {
  531. Type string `json:"type"`
  532. Size int `json:"size,"`
  533. Width float64 `json:"width"`
  534. Border struct {
  535. Color string `json:"color"`
  536. None bool `json:"none"`
  537. } `json:"border"`
  538. Fill struct {
  539. Color string `json:"color"`
  540. None bool `json:"none"`
  541. } `json:"fill"`
  542. } `json:"marker"`
  543. }
  544. // formatChartTitle directly maps the format settings of the chart title.
  545. type formatChartTitle struct {
  546. None bool `json:"none"`
  547. Name string `json:"name"`
  548. Overlay bool `json:"overlay"`
  549. Layout formatLayout `json:"layout"`
  550. }
  551. // formatLayout directly maps the format settings of the element layout.
  552. type formatLayout struct {
  553. X float64 `json:"x"`
  554. Y float64 `json:"y"`
  555. Width float64 `json:"width"`
  556. Height float64 `json:"height"`
  557. }