xmlChart.go 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  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. // attrValBool directly maps the val element with boolean data type as an
  125. // attribute。
  126. type attrValBool struct {
  127. Val bool `xml:"val,attr"`
  128. }
  129. // attrValString directly maps the val element with string data type as an
  130. // attribute。
  131. type attrValString struct {
  132. Val string `xml:"val,attr"`
  133. }
  134. // aCs directly maps the a:cs element.
  135. type aCs struct {
  136. Typeface string `xml:"typeface,attr"`
  137. }
  138. // aEa directly maps the a:ea element.
  139. type aEa struct {
  140. Typeface string `xml:"typeface,attr"`
  141. }
  142. // aLatin (Latin Font) directly maps the a:latin element. This element
  143. // specifies that a Latin font be used for a specific run of text. This font is
  144. // specified with a typeface attribute much like the others but is specifically
  145. // classified as a Latin font.
  146. type aLatin struct {
  147. Typeface string `xml:"typeface,attr"`
  148. }
  149. // aR directly maps the a:r element.
  150. type aR struct {
  151. RPr aRPr `xml:"a:rPr,omitempty"`
  152. T string `xml:"a:t,omitempty"`
  153. }
  154. // aRPr (Run Properties) directly maps the c:rPr element. This element
  155. // specifies a set of run properties which shall be applied to the contents of
  156. // the parent run after all style formatting has been applied to the text. These
  157. // properties are defined as direct formatting, since they are directly applied
  158. // to the run and supersede any formatting from styles.
  159. type aRPr struct {
  160. AltLang string `xml:"altLang,attr,omitempty"`
  161. B bool `xml:"b,attr"`
  162. Baseline int `xml:"baseline,attr"`
  163. Bmk string `xml:"bmk,attr,omitempty"`
  164. Cap string `xml:"cap,attr,omitempty"`
  165. Dirty bool `xml:"dirty,attr,omitempty"`
  166. Err bool `xml:"err,attr,omitempty"`
  167. I bool `xml:"i,attr"`
  168. Kern int `xml:"kern,attr"`
  169. Kumimoji bool `xml:"kumimoji,attr,omitempty"`
  170. Lang string `xml:"lang,attr,omitempty"`
  171. NoProof bool `xml:"noProof,attr,omitempty"`
  172. NormalizeH bool `xml:"normalizeH,attr,omitempty"`
  173. SmtClean bool `xml:"smtClean,attr,omitempty"`
  174. SmtID uint64 `xml:"smtId,attr,omitempty"`
  175. Spc int `xml:"spc,attr"`
  176. Strike string `xml:"strike,attr,omitempty"`
  177. Sz int `xml:"sz,attr,omitempty"`
  178. U string `xml:"u,attr,omitempty"`
  179. SolidFill *aSolidFill `xml:"a:solidFill"`
  180. Latin *aLatin `xml:"a:latin"`
  181. Ea *aEa `xml:"a:ea"`
  182. Cs *aCs `xml:"a:cs"`
  183. }
  184. // cSpPr (Shape Properties) directly maps the c:spPr element. This element
  185. // specifies the visual shape properties that can be applied to a shape. These
  186. // properties include the shape fill, outline, geometry, effects, and 3D
  187. // orientation.
  188. type cSpPr struct {
  189. NoFill *string `xml:"a:noFill"`
  190. SolidFill *aSolidFill `xml:"a:solidFill"`
  191. Ln *aLn `xml:"a:ln"`
  192. Sp3D *aSp3D `xml:"a:sp3d"`
  193. EffectLst *string `xml:"a:effectLst"`
  194. }
  195. // aSp3D (3-D Shape Properties) directly maps the a:sp3d element. This element
  196. // defines the 3D properties associated with a particular shape in DrawingML.
  197. // The 3D properties which can be applied to a shape are top and bottom bevels,
  198. // a contour and an extrusion.
  199. type aSp3D struct {
  200. ContourW int `xml:"contourW,attr"`
  201. ContourClr *aContourClr `xml:"a:contourClr"`
  202. }
  203. // aContourClr (Contour Color) directly maps the a:contourClr element. This
  204. // element defines the color for the contour on a shape. The contour of a shape
  205. // is a solid filled line which surrounds the outer edges of the shape.
  206. type aContourClr struct {
  207. SchemeClr *aSchemeClr `xml:"a:schemeClr"`
  208. }
  209. // aLn (Outline) directly maps the a:ln element. This element specifies an
  210. // outline style that can be applied to a number of different objects such as
  211. // shapes and text. The line allows for the specifying of many different types
  212. // of outlines including even line dashes and bevels.
  213. type aLn struct {
  214. Algn string `xml:"algn,attr,omitempty"`
  215. Cap string `xml:"cap,attr,omitempty"`
  216. Cmpd string `xml:"cmpd,attr,omitempty"`
  217. W int `xml:"w,attr,omitempty" `
  218. NoFill string `xml:"a:noFill,omitempty"`
  219. Round string `xml:"a:round,omitempty"`
  220. SolidFill *aSolidFill `xml:"a:solidFill"`
  221. }
  222. // cTxPr (Text Properties) directly maps the c:txPr element. This element
  223. // specifies text formatting. The lstStyle element is not supported.
  224. type cTxPr struct {
  225. BodyPr aBodyPr `xml:"a:bodyPr,omitempty"`
  226. LstStyle string `xml:"a:lstStyle,omitempty"`
  227. P aP `xml:"a:p,omitempty"`
  228. }
  229. // aEndParaRPr (End Paragraph Run Properties) directly maps the a:endParaRPr
  230. // element. This element specifies the text run properties that are to be used
  231. // if another run is inserted after the last run specified. This effectively
  232. // saves the run property state so that it can be applied when the user enters
  233. // additional text. If this element is omitted, then the application can
  234. // determine which default properties to apply. It is recommended that this
  235. // element be specified at the end of the list of text runs within the paragraph
  236. // so that an orderly list is maintained.
  237. type aEndParaRPr struct {
  238. Lang string `xml:"lang,attr"`
  239. AltLang string `xml:"altLang,attr,omitempty"`
  240. Sz int `xml:"sz,attr,omitempty"`
  241. }
  242. // cAutoTitleDeleted (Auto Title Is Deleted) directly maps the
  243. // c:autoTitleDeleted element. This element specifies the title shall not be
  244. // shown for this chart.
  245. type cAutoTitleDeleted struct {
  246. Val bool `xml:"val,attr"`
  247. }
  248. // cView3D (View In 3D) directly maps the c:view3D element. This element
  249. // specifies the 3-D view of the chart.
  250. type cView3D struct {
  251. RotX *attrValInt `xml:"c:rotX"`
  252. RotY *attrValInt `xml:"c:rotY"`
  253. DepthPercent *attrValInt `xml:"c:depthPercent"`
  254. RAngAx *attrValInt `xml:"c:rAngAx"`
  255. }
  256. // cPlotArea directly maps the c:plotArea element. This element specifies the
  257. // plot area of the chart.
  258. type cPlotArea struct {
  259. Layout *string `xml:"c:layout"`
  260. BarChart *cCharts `xml:"c:barChart"`
  261. Bar3DChart *cCharts `xml:"c:bar3DChart"`
  262. DoughnutChart *cCharts `xml:"c:doughnutChart"`
  263. LineChart *cCharts `xml:"c:lineChart"`
  264. PieChart *cCharts `xml:"c:pieChart"`
  265. Pie3DChart *cCharts `xml:"c:pie3DChart"`
  266. RadarChart *cCharts `xml:"c:radarChart"`
  267. ScatterChart *cCharts `xml:"c:scatterChart"`
  268. CatAx []*cAxs `xml:"c:catAx"`
  269. ValAx []*cAxs `xml:"c:valAx"`
  270. SpPr *cSpPr `xml:"c:spPr"`
  271. }
  272. // cCharts specifies the common element of the chart.
  273. type cCharts struct {
  274. BarDir *attrValString `xml:"c:barDir"`
  275. Grouping *attrValString `xml:"c:grouping"`
  276. RadarStyle *attrValString `xml:"c:radarStyle"`
  277. ScatterStyle *attrValString `xml:"c:scatterStyle"`
  278. VaryColors *attrValBool `xml:"c:varyColors"`
  279. Ser *[]cSer `xml:"c:ser"`
  280. DLbls *cDLbls `xml:"c:dLbls"`
  281. HoleSize *attrValInt `xml:"c:holeSize"`
  282. Smooth *attrValBool `xml:"c:smooth"`
  283. AxID []*attrValInt `xml:"c:axId"`
  284. }
  285. // cAxs directly maps the c:catAx and c:valAx element.
  286. type cAxs struct {
  287. AxID *attrValInt `xml:"c:axId"`
  288. Scaling *cScaling `xml:"c:scaling"`
  289. Delete *attrValBool `xml:"c:delete"`
  290. AxPos *attrValString `xml:"c:axPos"`
  291. NumFmt *cNumFmt `xml:"c:numFmt"`
  292. MajorTickMark *attrValString `xml:"c:majorTickMark"`
  293. MinorTickMark *attrValString `xml:"c:minorTickMark"`
  294. TickLblPos *attrValString `xml:"c:tickLblPos"`
  295. SpPr *cSpPr `xml:"c:spPr"`
  296. TxPr *cTxPr `xml:"c:txPr"`
  297. CrossAx *attrValInt `xml:"c:crossAx"`
  298. Crosses *attrValString `xml:"c:crosses"`
  299. CrossBetween *attrValString `xml:"c:crossBetween"`
  300. Auto *attrValBool `xml:"c:auto"`
  301. LblAlgn *attrValString `xml:"c:lblAlgn"`
  302. LblOffset *attrValInt `xml:"c:lblOffset"`
  303. NoMultiLvlLbl *attrValBool `xml:"c:noMultiLvlLbl"`
  304. }
  305. // cScaling directly maps the c:scaling element. This element contains
  306. // additional axis settings.
  307. type cScaling struct {
  308. Orientation *attrValString `xml:"c:orientation"`
  309. }
  310. // cNumFmt (Numbering Format) directly maps the c:numFmt element. This element
  311. // specifies number formatting for the parent element.
  312. type cNumFmt struct {
  313. FormatCode string `xml:"formatCode,attr"`
  314. SourceLinked bool `xml:"sourceLinked,attr"`
  315. }
  316. // cSer directly maps the c:ser element. This element specifies a series on a
  317. // chart.
  318. type cSer struct {
  319. IDx *attrValInt `xml:"c:idx"`
  320. Order *attrValInt `xml:"c:order"`
  321. Tx *cTx `xml:"c:tx"`
  322. SpPr *cSpPr `xml:"c:spPr"`
  323. DPt []*cDPt `xml:"c:dPt"`
  324. DLbls *cDLbls `xml:"c:dLbls"`
  325. Marker *cMarker `xml:"c:marker"`
  326. InvertIfNegative *attrValBool `xml:"c:invertIfNegative"`
  327. Cat *cCat `xml:"c:cat"`
  328. Val *cVal `xml:"c:val"`
  329. XVal *cCat `xml:"c:xVal"`
  330. YVal *cVal `xml:"c:yVal"`
  331. Smooth *attrValBool `xml:"c:smooth"`
  332. }
  333. // cMarker (Marker) directly maps the c:marker element. This element specifies a
  334. // data marker.
  335. type cMarker struct {
  336. Symbol *attrValString `xml:"c:symbol"`
  337. Size *attrValInt `xml:"c:size"`
  338. SpPr *cSpPr `xml:"c:spPr"`
  339. }
  340. // cDPt (Data Point) directly maps the c:dPt element. This element specifies a
  341. // single data point.
  342. type cDPt struct {
  343. IDx *attrValInt `xml:"c:idx"`
  344. Bubble3D *attrValBool `xml:"c:bubble3D"`
  345. SpPr *cSpPr `xml:"c:spPr"`
  346. }
  347. // cCat (Category Axis Data) directly maps the c:cat element. This element
  348. // specifies the data used for the category axis.
  349. type cCat struct {
  350. StrRef *cStrRef `xml:"c:strRef"`
  351. }
  352. // cStrRef (String Reference) directly maps the c:strRef element. This element
  353. // specifies a reference to data for a single data label or title with a cache
  354. // of the last values used.
  355. type cStrRef struct {
  356. F string `xml:"c:f"`
  357. StrCache *cStrCache `xml:"c:strCache"`
  358. }
  359. // cStrCache (String Cache) directly maps the c:strCache element. This element
  360. // specifies the last string data used for a chart.
  361. type cStrCache struct {
  362. Pt []*cPt `xml:"c:pt"`
  363. PtCount *attrValInt `xml:"c:ptCount"`
  364. }
  365. // cPt directly maps the c:pt element. This element specifies data for a
  366. // particular data point.
  367. type cPt struct {
  368. IDx int `xml:"idx,attr"`
  369. V *string `xml:"c:v"`
  370. }
  371. // cVal directly maps the c:val element. This element specifies the data values
  372. // which shall be used to define the location of data markers on a chart.
  373. type cVal struct {
  374. NumRef *cNumRef `xml:"c:numRef"`
  375. }
  376. // cNumRef directly maps the c:numRef element. This element specifies a
  377. // reference to numeric data with a cache of the last values used.
  378. type cNumRef struct {
  379. F string `xml:"c:f"`
  380. NumCache *cNumCache `xml:"c:numCache"`
  381. }
  382. // cNumCache directly maps the c:numCache element. This element specifies the
  383. // last data shown on the chart for a series.
  384. type cNumCache struct {
  385. FormatCode string `xml:"c:formatCode"`
  386. Pt []*cPt `xml:"c:pt"`
  387. PtCount *attrValInt `xml:"c:ptCount"`
  388. }
  389. // cDLbls (Data Lables) directly maps the c:dLbls element. This element serves
  390. // as a root element that specifies the settings for the data labels for an
  391. // entire series or the entire chart. It contains child elements that specify
  392. // the specific formatting and positioning settings.
  393. type cDLbls struct {
  394. ShowLegendKey *attrValBool `xml:"c:showLegendKey"`
  395. ShowVal *attrValBool `xml:"c:showVal"`
  396. ShowCatName *attrValBool `xml:"c:showCatName"`
  397. ShowSerName *attrValBool `xml:"c:showSerName"`
  398. ShowPercent *attrValBool `xml:"c:showPercent"`
  399. ShowBubbleSize *attrValBool `xml:"c:showBubbleSize"`
  400. ShowLeaderLines *attrValBool `xml:"c:showLeaderLines"`
  401. }
  402. // cLegend (Legend) directly maps the c:legend element. This element specifies
  403. // the legend.
  404. type cLegend struct {
  405. Layout *string `xml:"c:layout"`
  406. LegendPos *attrValString `xml:"c:legendPos"`
  407. Overlay *attrValBool `xml:"c:overlay"`
  408. SpPr *cSpPr `xml:"c:spPr"`
  409. TxPr *cTxPr `xml:"c:txPr"`
  410. }
  411. // cPrintSettings directly maps the c:printSettings element. This element
  412. // specifies the print settings for the chart.
  413. type cPrintSettings struct {
  414. HeaderFooter *string `xml:"c:headerFooter"`
  415. PageMargins *cPageMargins `xml:"c:pageMargins"`
  416. PageSetup *string `xml:"c:pageSetup"`
  417. }
  418. // cPageMargins directly maps the c:pageMargins element. This element specifies
  419. // the page margins for a chart.
  420. type cPageMargins struct {
  421. B float64 `xml:"b,attr"`
  422. Footer float64 `xml:"footer,attr"`
  423. Header float64 `xml:"header,attr"`
  424. L float64 `xml:"l,attr"`
  425. R float64 `xml:"r,attr"`
  426. T float64 `xml:"t,attr"`
  427. }
  428. // formatChartAxis directly maps the format settings of the chart axis.
  429. type formatChartAxis struct {
  430. Crossing string `json:"crossing"`
  431. MajorTickMark string `json:"major_tick_mark"`
  432. MinorTickMark string `json:"minor_tick_mark"`
  433. MinorUnitType string `json:"minor_unit_type"`
  434. MajorUnit int `json:"major_unit"`
  435. MajorUnitType string `json:"major_unit_type"`
  436. DisplayUnits string `json:"display_units"`
  437. DisplayUnitsVisible bool `json:"display_units_visible"`
  438. DateAxis bool `json:"date_axis"`
  439. NumFormat string `json:"num_format"`
  440. NumFont struct {
  441. Color string `json:"color"`
  442. Bold bool `json:"bold"`
  443. Italic bool `json:"italic"`
  444. Underline bool `json:"underline"`
  445. } `json:"num_font"`
  446. NameLayout formatLayout `json:"name_layout"`
  447. }
  448. // formatChart directly maps the format settings of the chart.
  449. type formatChart struct {
  450. Type string `json:"type"`
  451. Series []formatChartSeries `json:"series"`
  452. Format formatPicture `json:"format"`
  453. Legend formatChartLegend `json:"legend"`
  454. Title formatChartTitle `json:"title"`
  455. XAxis formatChartAxis `json:"x_axis"`
  456. YAxis formatChartAxis `json:"y_axis"`
  457. Chartarea struct {
  458. Border struct {
  459. None bool `json:"none"`
  460. } `json:"border"`
  461. Fill struct {
  462. Color string `json:"color"`
  463. } `json:"fill"`
  464. Pattern struct {
  465. Pattern string `json:"pattern"`
  466. FgColor string `json:"fg_color"`
  467. BgColor string `json:"bg_color"`
  468. } `json:"pattern"`
  469. } `json:"chartarea"`
  470. Plotarea struct {
  471. ShowBubbleSize bool `json:"show_bubble_size"`
  472. ShowCatName bool `json:"show_cat_name"`
  473. ShowLeaderLines bool `json:"show_leader_lines"`
  474. ShowPercent bool `json:"show_percent"`
  475. ShowSerName bool `json:"show_series_name"`
  476. ShowVal bool `json:"show_val"`
  477. Gradient struct {
  478. Colors []string `json:"colors"`
  479. } `json:"gradient"`
  480. Border struct {
  481. Color string `json:"color"`
  482. Width int `json:"width"`
  483. DashType string `json:"dash_type"`
  484. } `json:"border"`
  485. Fill struct {
  486. Color string `json:"color"`
  487. } `json:"fill"`
  488. Layout formatLayout `json:"layout"`
  489. } `json:"plotarea"`
  490. ShowBlanksAs string `json:"show_blanks_as"`
  491. ShowHiddenData bool `json:"show_hidden_data"`
  492. SetRotation int `json:"set_rotation"`
  493. SetHoleSize int `json:"set_hole_size"`
  494. }
  495. // formatChartLegend directly maps the format settings of the chart legend.
  496. type formatChartLegend struct {
  497. None bool `json:"none"`
  498. DeleteSeries []int `json:"delete_series"`
  499. Font formatFont `json:"font"`
  500. Layout formatLayout `json:"layout"`
  501. Position string `json:"position"`
  502. ShowLegendEntry bool `json:"show_legend_entry"`
  503. ShowLegendKey bool `json:"show_legend_key"`
  504. }
  505. // formatChartSeries directly maps the format settings of the chart series.
  506. type formatChartSeries struct {
  507. Name string `json:"name"`
  508. Categories string `json:"categories"`
  509. Values string `json:"values"`
  510. Line struct {
  511. None bool `json:"none"`
  512. Color string `json:"color"`
  513. } `json:"line"`
  514. Marker struct {
  515. Type string `json:"type"`
  516. Size int `json:"size,"`
  517. Width float64 `json:"width"`
  518. Border struct {
  519. Color string `json:"color"`
  520. None bool `json:"none"`
  521. } `json:"border"`
  522. Fill struct {
  523. Color string `json:"color"`
  524. None bool `json:"none"`
  525. } `json:"fill"`
  526. } `json:"marker"`
  527. }
  528. // formatChartTitle directly maps the format settings of the chart title.
  529. type formatChartTitle struct {
  530. None bool `json:"none"`
  531. Name string `json:"name"`
  532. Overlay bool `json:"overlay"`
  533. Layout formatLayout `json:"layout"`
  534. }
  535. // formatLayout directly maps the format settings of the element layout.
  536. type formatLayout struct {
  537. X float64 `json:"x"`
  538. Y float64 `json:"y"`
  539. Width float64 `json:"width"`
  540. Height float64 `json:"height"`
  541. }