xmlChart.go 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  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. }
  316. // cNumFmt (Numbering Format) directly maps the c:numFmt element. This element
  317. // specifies number formatting for the parent element.
  318. type cNumFmt struct {
  319. FormatCode string `xml:"formatCode,attr"`
  320. SourceLinked bool `xml:"sourceLinked,attr"`
  321. }
  322. // cSer directly maps the c:ser element. This element specifies a series on a
  323. // chart.
  324. type cSer struct {
  325. IDx *attrValInt `xml:"c:idx"`
  326. Order *attrValInt `xml:"c:order"`
  327. Tx *cTx `xml:"c:tx"`
  328. SpPr *cSpPr `xml:"c:spPr"`
  329. DPt []*cDPt `xml:"c:dPt"`
  330. DLbls *cDLbls `xml:"c:dLbls"`
  331. Marker *cMarker `xml:"c:marker"`
  332. InvertIfNegative *attrValBool `xml:"c:invertIfNegative"`
  333. Cat *cCat `xml:"c:cat"`
  334. Val *cVal `xml:"c:val"`
  335. XVal *cCat `xml:"c:xVal"`
  336. YVal *cVal `xml:"c:yVal"`
  337. Smooth *attrValBool `xml:"c:smooth"`
  338. }
  339. // cMarker (Marker) directly maps the c:marker element. This element specifies a
  340. // data marker.
  341. type cMarker struct {
  342. Symbol *attrValString `xml:"c:symbol"`
  343. Size *attrValInt `xml:"c:size"`
  344. SpPr *cSpPr `xml:"c:spPr"`
  345. }
  346. // cDPt (Data Point) directly maps the c:dPt element. This element specifies a
  347. // single data point.
  348. type cDPt struct {
  349. IDx *attrValInt `xml:"c:idx"`
  350. Bubble3D *attrValBool `xml:"c:bubble3D"`
  351. SpPr *cSpPr `xml:"c:spPr"`
  352. }
  353. // cCat (Category Axis Data) directly maps the c:cat element. This element
  354. // specifies the data used for the category axis.
  355. type cCat struct {
  356. StrRef *cStrRef `xml:"c:strRef"`
  357. }
  358. // cStrRef (String Reference) directly maps the c:strRef element. This element
  359. // specifies a reference to data for a single data label or title with a cache
  360. // of the last values used.
  361. type cStrRef struct {
  362. F string `xml:"c:f"`
  363. StrCache *cStrCache `xml:"c:strCache"`
  364. }
  365. // cStrCache (String Cache) directly maps the c:strCache element. This element
  366. // specifies the last string data used for a chart.
  367. type cStrCache struct {
  368. Pt []*cPt `xml:"c:pt"`
  369. PtCount *attrValInt `xml:"c:ptCount"`
  370. }
  371. // cPt directly maps the c:pt element. This element specifies data for a
  372. // particular data point.
  373. type cPt struct {
  374. IDx int `xml:"idx,attr"`
  375. V *string `xml:"c:v"`
  376. }
  377. // cVal directly maps the c:val element. This element specifies the data values
  378. // which shall be used to define the location of data markers on a chart.
  379. type cVal struct {
  380. NumRef *cNumRef `xml:"c:numRef"`
  381. }
  382. // cNumRef directly maps the c:numRef element. This element specifies a
  383. // reference to numeric data with a cache of the last values used.
  384. type cNumRef struct {
  385. F string `xml:"c:f"`
  386. NumCache *cNumCache `xml:"c:numCache"`
  387. }
  388. // cNumCache directly maps the c:numCache element. This element specifies the
  389. // last data shown on the chart for a series.
  390. type cNumCache struct {
  391. FormatCode string `xml:"c:formatCode"`
  392. Pt []*cPt `xml:"c:pt"`
  393. PtCount *attrValInt `xml:"c:ptCount"`
  394. }
  395. // cDLbls (Data Lables) directly maps the c:dLbls element. This element serves
  396. // as a root element that specifies the settings for the data labels for an
  397. // entire series or the entire chart. It contains child elements that specify
  398. // the specific formatting and positioning settings.
  399. type cDLbls struct {
  400. ShowLegendKey *attrValBool `xml:"c:showLegendKey"`
  401. ShowVal *attrValBool `xml:"c:showVal"`
  402. ShowCatName *attrValBool `xml:"c:showCatName"`
  403. ShowSerName *attrValBool `xml:"c:showSerName"`
  404. ShowPercent *attrValBool `xml:"c:showPercent"`
  405. ShowBubbleSize *attrValBool `xml:"c:showBubbleSize"`
  406. ShowLeaderLines *attrValBool `xml:"c:showLeaderLines"`
  407. }
  408. // cLegend (Legend) directly maps the c:legend element. This element specifies
  409. // the legend.
  410. type cLegend struct {
  411. Layout *string `xml:"c:layout"`
  412. LegendPos *attrValString `xml:"c:legendPos"`
  413. Overlay *attrValBool `xml:"c:overlay"`
  414. SpPr *cSpPr `xml:"c:spPr"`
  415. TxPr *cTxPr `xml:"c:txPr"`
  416. }
  417. // cPrintSettings directly maps the c:printSettings element. This element
  418. // specifies the print settings for the chart.
  419. type cPrintSettings struct {
  420. HeaderFooter *string `xml:"c:headerFooter"`
  421. PageMargins *cPageMargins `xml:"c:pageMargins"`
  422. PageSetup *string `xml:"c:pageSetup"`
  423. }
  424. // cPageMargins directly maps the c:pageMargins element. This element specifies
  425. // the page margins for a chart.
  426. type cPageMargins struct {
  427. B float64 `xml:"b,attr"`
  428. Footer float64 `xml:"footer,attr"`
  429. Header float64 `xml:"header,attr"`
  430. L float64 `xml:"l,attr"`
  431. R float64 `xml:"r,attr"`
  432. T float64 `xml:"t,attr"`
  433. }
  434. // formatChartAxis directly maps the format settings of the chart axis.
  435. type formatChartAxis struct {
  436. Crossing string `json:"crossing"`
  437. MajorTickMark string `json:"major_tick_mark"`
  438. MinorTickMark string `json:"minor_tick_mark"`
  439. MinorUnitType string `json:"minor_unit_type"`
  440. MajorUnit int `json:"major_unit"`
  441. MajorUnitType string `json:"major_unit_type"`
  442. DisplayUnits string `json:"display_units"`
  443. DisplayUnitsVisible bool `json:"display_units_visible"`
  444. DateAxis bool `json:"date_axis"`
  445. NumFormat string `json:"num_format"`
  446. NumFont struct {
  447. Color string `json:"color"`
  448. Bold bool `json:"bold"`
  449. Italic bool `json:"italic"`
  450. Underline bool `json:"underline"`
  451. } `json:"num_font"`
  452. NameLayout formatLayout `json:"name_layout"`
  453. }
  454. // formatChart directly maps the format settings of the chart.
  455. type formatChart struct {
  456. Type string `json:"type"`
  457. Series []formatChartSeries `json:"series"`
  458. Format formatPicture `json:"format"`
  459. Legend formatChartLegend `json:"legend"`
  460. Title formatChartTitle `json:"title"`
  461. XAxis formatChartAxis `json:"x_axis"`
  462. YAxis formatChartAxis `json:"y_axis"`
  463. Chartarea struct {
  464. Border struct {
  465. None bool `json:"none"`
  466. } `json:"border"`
  467. Fill struct {
  468. Color string `json:"color"`
  469. } `json:"fill"`
  470. Pattern struct {
  471. Pattern string `json:"pattern"`
  472. FgColor string `json:"fg_color"`
  473. BgColor string `json:"bg_color"`
  474. } `json:"pattern"`
  475. } `json:"chartarea"`
  476. Plotarea struct {
  477. ShowBubbleSize bool `json:"show_bubble_size"`
  478. ShowCatName bool `json:"show_cat_name"`
  479. ShowLeaderLines bool `json:"show_leader_lines"`
  480. ShowPercent bool `json:"show_percent"`
  481. ShowSerName bool `json:"show_series_name"`
  482. ShowVal bool `json:"show_val"`
  483. Gradient struct {
  484. Colors []string `json:"colors"`
  485. } `json:"gradient"`
  486. Border struct {
  487. Color string `json:"color"`
  488. Width int `json:"width"`
  489. DashType string `json:"dash_type"`
  490. } `json:"border"`
  491. Fill struct {
  492. Color string `json:"color"`
  493. } `json:"fill"`
  494. Layout formatLayout `json:"layout"`
  495. } `json:"plotarea"`
  496. ShowBlanksAs string `json:"show_blanks_as"`
  497. ShowHiddenData bool `json:"show_hidden_data"`
  498. SetRotation int `json:"set_rotation"`
  499. SetHoleSize int `json:"set_hole_size"`
  500. }
  501. // formatChartLegend directly maps the format settings of the chart legend.
  502. type formatChartLegend struct {
  503. None bool `json:"none"`
  504. DeleteSeries []int `json:"delete_series"`
  505. Font formatFont `json:"font"`
  506. Layout formatLayout `json:"layout"`
  507. Position string `json:"position"`
  508. ShowLegendEntry bool `json:"show_legend_entry"`
  509. ShowLegendKey bool `json:"show_legend_key"`
  510. }
  511. // formatChartSeries directly maps the format settings of the chart series.
  512. type formatChartSeries struct {
  513. Name string `json:"name"`
  514. Categories string `json:"categories"`
  515. Values string `json:"values"`
  516. Line struct {
  517. None bool `json:"none"`
  518. Color string `json:"color"`
  519. } `json:"line"`
  520. Marker struct {
  521. Type string `json:"type"`
  522. Size int `json:"size,"`
  523. Width float64 `json:"width"`
  524. Border struct {
  525. Color string `json:"color"`
  526. None bool `json:"none"`
  527. } `json:"border"`
  528. Fill struct {
  529. Color string `json:"color"`
  530. None bool `json:"none"`
  531. } `json:"fill"`
  532. } `json:"marker"`
  533. }
  534. // formatChartTitle directly maps the format settings of the chart title.
  535. type formatChartTitle struct {
  536. None bool `json:"none"`
  537. Name string `json:"name"`
  538. Overlay bool `json:"overlay"`
  539. Layout formatLayout `json:"layout"`
  540. }
  541. // formatLayout directly maps the format settings of the element layout.
  542. type formatLayout struct {
  543. X float64 `json:"x"`
  544. Y float64 `json:"y"`
  545. Width float64 `json:"width"`
  546. Height float64 `json:"height"`
  547. }