From cff16fa8118291fd885f3f3f75fa07e28bba5eec Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 5 Jun 2019 22:06:15 +0800 Subject: - Supplemental worksheet struct fields and field order adjustment - Testing case for set and get doc properties - Update charts struct XML tags --- xmlChart.go | 328 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 164 insertions(+), 164 deletions(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index 163812d..972ead3 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -11,66 +11,66 @@ package excelize import "encoding/xml" -// xlsxChartSpace directly maps the c:chartSpace element. The chart namespace in +// xlsxChartSpace directly maps the chartSpace element. The chart namespace in // DrawingML is for representing visualizations of numeric data with column // charts, pie charts, scatter charts, or other types of charts. type xlsxChartSpace struct { - XMLName xml.Name `xml:"c:chartSpace"` + XMLName xml.Name `xml:"http://schemas.openxmlformats.org/drawingml/2006/chart chartSpace"` XMLNSc string `xml:"xmlns:c,attr"` XMLNSa string `xml:"xmlns:a,attr"` XMLNSr string `xml:"xmlns:r,attr"` XMLNSc16r2 string `xml:"xmlns:c16r2,attr"` - Date1904 *attrValBool `xml:"c:date1904"` - Lang *attrValString `xml:"c:lang"` - RoundedCorners *attrValBool `xml:"c:roundedCorners"` - Chart cChart `xml:"c:chart"` - SpPr *cSpPr `xml:"c:spPr"` - TxPr *cTxPr `xml:"c:txPr"` - PrintSettings *cPrintSettings `xml:"c:printSettings"` -} - -// cThicknessSpPr directly maps the element that specifies the thickness of the -// walls or floor as a percentage of the largest dimension of the plot volume -// and SpPr element. + Date1904 *attrValBool `xml:"date1904"` + Lang *attrValString `xml:"lang"` + RoundedCorners *attrValBool `xml:"roundedCorners"` + Chart cChart `xml:"chart"` + SpPr *cSpPr `xml:"spPr"` + TxPr *cTxPr `xml:"txPr"` + PrintSettings *cPrintSettings `xml:"printSettings"` +} + +// cThicknessSpPr directly maps the element that specifies the thickness of +// the walls or floor as a percentage of the largest dimension of the plot +// volume and SpPr element. type cThicknessSpPr struct { - Thickness *attrValInt `xml:"c:thickness"` - SpPr *cSpPr `xml:"c:spPr"` + Thickness *attrValInt `xml:"thickness"` + SpPr *cSpPr `xml:"spPr"` } -// cChart (Chart) directly maps the c:chart element. This element specifies a +// cChart (Chart) directly maps the chart element. This element specifies a // title. type cChart struct { - Title *cTitle `xml:"c:title"` - AutoTitleDeleted *cAutoTitleDeleted `xml:"c:autoTitleDeleted"` - View3D *cView3D `xml:"c:view3D"` - Floor *cThicknessSpPr `xml:"c:floor"` - SideWall *cThicknessSpPr `xml:"c:sideWall"` - BackWall *cThicknessSpPr `xml:"c:backWall"` - PlotArea *cPlotArea `xml:"c:plotArea"` - Legend *cLegend `xml:"c:legend"` - PlotVisOnly *attrValBool `xml:"c:plotVisOnly"` - DispBlanksAs *attrValString `xml:"c:dispBlanksAs"` - ShowDLblsOverMax *attrValBool `xml:"c:showDLblsOverMax"` -} - -// cTitle (Title) directly maps the c:title element. This element specifies a + Title *cTitle `xml:"title"` + AutoTitleDeleted *cAutoTitleDeleted `xml:"autoTitleDeleted"` + View3D *cView3D `xml:"view3D"` + Floor *cThicknessSpPr `xml:"floor"` + SideWall *cThicknessSpPr `xml:"sideWall"` + BackWall *cThicknessSpPr `xml:"backWall"` + PlotArea *cPlotArea `xml:"plotArea"` + Legend *cLegend `xml:"legend"` + PlotVisOnly *attrValBool `xml:"plotVisOnly"` + DispBlanksAs *attrValString `xml:"dispBlanksAs"` + ShowDLblsOverMax *attrValBool `xml:"showDLblsOverMax"` +} + +// cTitle (Title) directly maps the title element. This element specifies a // title. type cTitle struct { - Tx cTx `xml:"c:tx,omitempty"` - Layout string `xml:"c:layout,omitempty"` - Overlay attrValBool `xml:"c:overlay,omitempty"` - SpPr cSpPr `xml:"c:spPr,omitempty"` - TxPr cTxPr `xml:"c:txPr,omitempty"` + Tx cTx `xml:"tx,omitempty"` + Layout string `xml:"layout,omitempty"` + Overlay attrValBool `xml:"overlay,omitempty"` + SpPr cSpPr `xml:"spPr,omitempty"` + TxPr cTxPr `xml:"txPr,omitempty"` } -// cTx (Chart Text) directly maps the c:tx element. This element specifies text +// cTx (Chart Text) directly maps the tx element. This element specifies text // to use on a chart, including rich text formatting. type cTx struct { - StrRef *cStrRef `xml:"c:strRef"` - Rich *cRich `xml:"c:rich,omitempty"` + StrRef *cStrRef `xml:"strRef"` + Rich *cRich `xml:"rich,omitempty"` } -// cRich (Rich Text) directly maps the c:rich element. This element contains a +// cRich (Rich Text) directly maps the rich element. This element contains a // string with rich text formatting. type cRich struct { BodyPr aBodyPr `xml:"a:bodyPr,omitempty"` @@ -186,7 +186,7 @@ type aR struct { T string `xml:"a:t,omitempty"` } -// aRPr (Run Properties) directly maps the c:rPr element. This element +// aRPr (Run Properties) directly maps the rPr element. This element // specifies a set of run properties which shall be applied to the contents of // the parent run after all style formatting has been applied to the text. These // properties are defined as direct formatting, since they are directly applied @@ -217,7 +217,7 @@ type aRPr struct { Cs *aCs `xml:"a:cs"` } -// cSpPr (Shape Properties) directly maps the c:spPr element. This element +// cSpPr (Shape Properties) directly maps the spPr element. This element // specifies the visual shape properties that can be applied to a shape. These // properties include the shape fill, outline, geometry, effects, and 3D // orientation. @@ -259,7 +259,7 @@ type aLn struct { SolidFill *aSolidFill `xml:"a:solidFill"` } -// cTxPr (Text Properties) directly maps the c:txPr element. This element +// cTxPr (Text Properties) directly maps the txPr element. This element // specifies text formatting. The lstStyle element is not supported. type cTxPr struct { BodyPr aBodyPr `xml:"a:bodyPr,omitempty"` @@ -282,207 +282,207 @@ type aEndParaRPr struct { } // cAutoTitleDeleted (Auto Title Is Deleted) directly maps the -// c:autoTitleDeleted element. This element specifies the title shall not be +// autoTitleDeleted element. This element specifies the title shall not be // shown for this chart. type cAutoTitleDeleted struct { Val bool `xml:"val,attr"` } -// cView3D (View In 3D) directly maps the c:view3D element. This element +// cView3D (View In 3D) directly maps the view3D element. This element // specifies the 3-D view of the chart. type cView3D struct { - RotX *attrValInt `xml:"c:rotX"` - RotY *attrValInt `xml:"c:rotY"` - DepthPercent *attrValInt `xml:"c:depthPercent"` - RAngAx *attrValInt `xml:"c:rAngAx"` + RotX *attrValInt `xml:"rotX"` + RotY *attrValInt `xml:"rotY"` + DepthPercent *attrValInt `xml:"depthPercent"` + RAngAx *attrValInt `xml:"rAngAx"` } -// cPlotArea directly maps the c:plotArea element. This element specifies the +// cPlotArea directly maps the plotArea element. This element specifies the // plot area of the chart. type cPlotArea struct { - Layout *string `xml:"c:layout"` - AreaChart *cCharts `xml:"c:areaChart"` - Area3DChart *cCharts `xml:"c:area3DChart"` - BarChart *cCharts `xml:"c:barChart"` - Bar3DChart *cCharts `xml:"c:bar3DChart"` - DoughnutChart *cCharts `xml:"c:doughnutChart"` - LineChart *cCharts `xml:"c:lineChart"` - PieChart *cCharts `xml:"c:pieChart"` - Pie3DChart *cCharts `xml:"c:pie3DChart"` - RadarChart *cCharts `xml:"c:radarChart"` - ScatterChart *cCharts `xml:"c:scatterChart"` - CatAx []*cAxs `xml:"c:catAx"` - ValAx []*cAxs `xml:"c:valAx"` - SpPr *cSpPr `xml:"c:spPr"` + Layout *string `xml:"layout"` + AreaChart *cCharts `xml:"areaChart"` + Area3DChart *cCharts `xml:"area3DChart"` + BarChart *cCharts `xml:"barChart"` + Bar3DChart *cCharts `xml:"bar3DChart"` + DoughnutChart *cCharts `xml:"doughnutChart"` + LineChart *cCharts `xml:"lineChart"` + PieChart *cCharts `xml:"pieChart"` + Pie3DChart *cCharts `xml:"pie3DChart"` + RadarChart *cCharts `xml:"radarChart"` + ScatterChart *cCharts `xml:"scatterChart"` + CatAx []*cAxs `xml:"catAx"` + ValAx []*cAxs `xml:"valAx"` + SpPr *cSpPr `xml:"spPr"` } // cCharts specifies the common element of the chart. type cCharts struct { - BarDir *attrValString `xml:"c:barDir"` - Grouping *attrValString `xml:"c:grouping"` - RadarStyle *attrValString `xml:"c:radarStyle"` - ScatterStyle *attrValString `xml:"c:scatterStyle"` - VaryColors *attrValBool `xml:"c:varyColors"` - Ser *[]cSer `xml:"c:ser"` - DLbls *cDLbls `xml:"c:dLbls"` - HoleSize *attrValInt `xml:"c:holeSize"` - Smooth *attrValBool `xml:"c:smooth"` - Overlap *attrValInt `xml:"c:overlap"` - AxID []*attrValInt `xml:"c:axId"` -} - -// cAxs directly maps the c:catAx and c:valAx element. + BarDir *attrValString `xml:"barDir"` + Grouping *attrValString `xml:"grouping"` + RadarStyle *attrValString `xml:"radarStyle"` + ScatterStyle *attrValString `xml:"scatterStyle"` + VaryColors *attrValBool `xml:"varyColors"` + Ser *[]cSer `xml:"ser"` + DLbls *cDLbls `xml:"dLbls"` + HoleSize *attrValInt `xml:"holeSize"` + Smooth *attrValBool `xml:"smooth"` + Overlap *attrValInt `xml:"overlap"` + AxID []*attrValInt `xml:"axId"` +} + +// cAxs directly maps the catAx and valAx element. type cAxs struct { - AxID *attrValInt `xml:"c:axId"` - Scaling *cScaling `xml:"c:scaling"` - Delete *attrValBool `xml:"c:delete"` - AxPos *attrValString `xml:"c:axPos"` - NumFmt *cNumFmt `xml:"c:numFmt"` - MajorTickMark *attrValString `xml:"c:majorTickMark"` - MinorTickMark *attrValString `xml:"c:minorTickMark"` - TickLblPos *attrValString `xml:"c:tickLblPos"` - SpPr *cSpPr `xml:"c:spPr"` - TxPr *cTxPr `xml:"c:txPr"` - CrossAx *attrValInt `xml:"c:crossAx"` - Crosses *attrValString `xml:"c:crosses"` - CrossBetween *attrValString `xml:"c:crossBetween"` - Auto *attrValBool `xml:"c:auto"` - LblAlgn *attrValString `xml:"c:lblAlgn"` - LblOffset *attrValInt `xml:"c:lblOffset"` - NoMultiLvlLbl *attrValBool `xml:"c:noMultiLvlLbl"` -} - -// cScaling directly maps the c:scaling element. This element contains + AxID *attrValInt `xml:"axId"` + Scaling *cScaling `xml:"scaling"` + Delete *attrValBool `xml:"delete"` + AxPos *attrValString `xml:"axPos"` + NumFmt *cNumFmt `xml:"numFmt"` + MajorTickMark *attrValString `xml:"majorTickMark"` + MinorTickMark *attrValString `xml:"minorTickMark"` + TickLblPos *attrValString `xml:"tickLblPos"` + SpPr *cSpPr `xml:"spPr"` + TxPr *cTxPr `xml:"txPr"` + CrossAx *attrValInt `xml:"crossAx"` + Crosses *attrValString `xml:"crosses"` + CrossBetween *attrValString `xml:"crossBetween"` + Auto *attrValBool `xml:"auto"` + LblAlgn *attrValString `xml:"lblAlgn"` + LblOffset *attrValInt `xml:"lblOffset"` + NoMultiLvlLbl *attrValBool `xml:"noMultiLvlLbl"` +} + +// cScaling directly maps the scaling element. This element contains // additional axis settings. type cScaling struct { - Orientation *attrValString `xml:"c:orientation"` - Max *attrValFloat `xml:"c:max"` - Min *attrValFloat `xml:"c:min"` + Orientation *attrValString `xml:"orientation"` + Max *attrValFloat `xml:"max"` + Min *attrValFloat `xml:"min"` } -// cNumFmt (Numbering Format) directly maps the c:numFmt element. This element +// cNumFmt (Numbering Format) directly maps the numFmt element. This element // specifies number formatting for the parent element. type cNumFmt struct { FormatCode string `xml:"formatCode,attr"` SourceLinked bool `xml:"sourceLinked,attr"` } -// cSer directly maps the c:ser element. This element specifies a series on a +// cSer directly maps the ser element. This element specifies a series on a // chart. type cSer struct { - IDx *attrValInt `xml:"c:idx"` - Order *attrValInt `xml:"c:order"` - Tx *cTx `xml:"c:tx"` - SpPr *cSpPr `xml:"c:spPr"` - DPt []*cDPt `xml:"c:dPt"` - DLbls *cDLbls `xml:"c:dLbls"` - Marker *cMarker `xml:"c:marker"` - InvertIfNegative *attrValBool `xml:"c:invertIfNegative"` - Cat *cCat `xml:"c:cat"` - Val *cVal `xml:"c:val"` - XVal *cCat `xml:"c:xVal"` - YVal *cVal `xml:"c:yVal"` - Smooth *attrValBool `xml:"c:smooth"` -} - -// cMarker (Marker) directly maps the c:marker element. This element specifies a + IDx *attrValInt `xml:"idx"` + Order *attrValInt `xml:"order"` + Tx *cTx `xml:"tx"` + SpPr *cSpPr `xml:"spPr"` + DPt []*cDPt `xml:"dPt"` + DLbls *cDLbls `xml:"dLbls"` + Marker *cMarker `xml:"marker"` + InvertIfNegative *attrValBool `xml:"invertIfNegative"` + Cat *cCat `xml:"cat"` + Val *cVal `xml:"val"` + XVal *cCat `xml:"xVal"` + YVal *cVal `xml:"yVal"` + Smooth *attrValBool `xml:"smooth"` +} + +// cMarker (Marker) directly maps the marker element. This element specifies a // data marker. type cMarker struct { - Symbol *attrValString `xml:"c:symbol"` - Size *attrValInt `xml:"c:size"` - SpPr *cSpPr `xml:"c:spPr"` + Symbol *attrValString `xml:"symbol"` + Size *attrValInt `xml:"size"` + SpPr *cSpPr `xml:"spPr"` } -// cDPt (Data Point) directly maps the c:dPt element. This element specifies a +// cDPt (Data Point) directly maps the dPt element. This element specifies a // single data point. type cDPt struct { - IDx *attrValInt `xml:"c:idx"` - Bubble3D *attrValBool `xml:"c:bubble3D"` - SpPr *cSpPr `xml:"c:spPr"` + IDx *attrValInt `xml:"idx"` + Bubble3D *attrValBool `xml:"bubble3D"` + SpPr *cSpPr `xml:"spPr"` } -// cCat (Category Axis Data) directly maps the c:cat element. This element +// cCat (Category Axis Data) directly maps the cat element. This element // specifies the data used for the category axis. type cCat struct { - StrRef *cStrRef `xml:"c:strRef"` + StrRef *cStrRef `xml:"strRef"` } -// cStrRef (String Reference) directly maps the c:strRef element. This element +// cStrRef (String Reference) directly maps the strRef element. This element // specifies a reference to data for a single data label or title with a cache // of the last values used. type cStrRef struct { - F string `xml:"c:f"` - StrCache *cStrCache `xml:"c:strCache"` + F string `xml:"f"` + StrCache *cStrCache `xml:"strCache"` } -// cStrCache (String Cache) directly maps the c:strCache element. This element +// cStrCache (String Cache) directly maps the strCache element. This element // specifies the last string data used for a chart. type cStrCache struct { - Pt []*cPt `xml:"c:pt"` - PtCount *attrValInt `xml:"c:ptCount"` + Pt []*cPt `xml:"pt"` + PtCount *attrValInt `xml:"ptCount"` } -// cPt directly maps the c:pt element. This element specifies data for a +// cPt directly maps the pt element. This element specifies data for a // particular data point. type cPt struct { IDx int `xml:"idx,attr"` - V *string `xml:"c:v"` + V *string `xml:"v"` } -// cVal directly maps the c:val element. This element specifies the data values +// cVal directly maps the val element. This element specifies the data values // which shall be used to define the location of data markers on a chart. type cVal struct { - NumRef *cNumRef `xml:"c:numRef"` + NumRef *cNumRef `xml:"numRef"` } -// cNumRef directly maps the c:numRef element. This element specifies a +// cNumRef directly maps the numRef element. This element specifies a // reference to numeric data with a cache of the last values used. type cNumRef struct { - F string `xml:"c:f"` - NumCache *cNumCache `xml:"c:numCache"` + F string `xml:"f"` + NumCache *cNumCache `xml:"numCache"` } -// cNumCache directly maps the c:numCache element. This element specifies the +// cNumCache directly maps the numCache element. This element specifies the // last data shown on the chart for a series. type cNumCache struct { - FormatCode string `xml:"c:formatCode"` - Pt []*cPt `xml:"c:pt"` - PtCount *attrValInt `xml:"c:ptCount"` + FormatCode string `xml:"formatCode"` + Pt []*cPt `xml:"pt"` + PtCount *attrValInt `xml:"ptCount"` } -// cDLbls (Data Lables) directly maps the c:dLbls element. This element serves +// cDLbls (Data Lables) directly maps the dLbls element. This element serves // as a root element that specifies the settings for the data labels for an // entire series or the entire chart. It contains child elements that specify // the specific formatting and positioning settings. type cDLbls struct { - ShowLegendKey *attrValBool `xml:"c:showLegendKey"` - ShowVal *attrValBool `xml:"c:showVal"` - ShowCatName *attrValBool `xml:"c:showCatName"` - ShowSerName *attrValBool `xml:"c:showSerName"` - ShowPercent *attrValBool `xml:"c:showPercent"` - ShowBubbleSize *attrValBool `xml:"c:showBubbleSize"` - ShowLeaderLines *attrValBool `xml:"c:showLeaderLines"` + ShowLegendKey *attrValBool `xml:"showLegendKey"` + ShowVal *attrValBool `xml:"showVal"` + ShowCatName *attrValBool `xml:"showCatName"` + ShowSerName *attrValBool `xml:"showSerName"` + ShowPercent *attrValBool `xml:"showPercent"` + ShowBubbleSize *attrValBool `xml:"showBubbleSize"` + ShowLeaderLines *attrValBool `xml:"showLeaderLines"` } -// cLegend (Legend) directly maps the c:legend element. This element specifies +// cLegend (Legend) directly maps the legend element. This element specifies // the legend. type cLegend struct { - Layout *string `xml:"c:layout"` - LegendPos *attrValString `xml:"c:legendPos"` - Overlay *attrValBool `xml:"c:overlay"` - SpPr *cSpPr `xml:"c:spPr"` - TxPr *cTxPr `xml:"c:txPr"` + Layout *string `xml:"layout"` + LegendPos *attrValString `xml:"legendPos"` + Overlay *attrValBool `xml:"overlay"` + SpPr *cSpPr `xml:"spPr"` + TxPr *cTxPr `xml:"txPr"` } -// cPrintSettings directly maps the c:printSettings element. This element +// cPrintSettings directly maps the printSettings element. This element // specifies the print settings for the chart. type cPrintSettings struct { - HeaderFooter *string `xml:"c:headerFooter"` - PageMargins *cPageMargins `xml:"c:pageMargins"` - PageSetup *string `xml:"c:pageSetup"` + HeaderFooter *string `xml:"headerFooter"` + PageMargins *cPageMargins `xml:"pageMargins"` + PageSetup *string `xml:"pageSetup"` } -// cPageMargins directly maps the c:pageMargins element. This element specifies +// cPageMargins directly maps the pageMargins element. This element specifies // the page margins for a chart. type cPageMargins struct { B float64 `xml:"b,attr"` -- cgit v1.2.1 From 3997dee1f58c81444733e1756da6138d4ce445f1 Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 7 Jun 2019 09:16:55 +0800 Subject: Fix #411, change font size to float type --- xmlChart.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 xmlChart.go (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go old mode 100644 new mode 100755 index 972ead3..d23364c --- a/xmlChart.go +++ b/xmlChart.go @@ -209,7 +209,7 @@ type aRPr struct { SmtID uint64 `xml:"smtId,attr,omitempty"` Spc int `xml:"spc,attr"` Strike string `xml:"strike,attr,omitempty"` - Sz int `xml:"sz,attr,omitempty"` + Sz float64 `xml:"sz,attr,omitempty"` U string `xml:"u,attr,omitempty"` SolidFill *aSolidFill `xml:"a:solidFill"` Latin *aLatin `xml:"a:latin"` -- cgit v1.2.1 From 821632cf89422b9955160a3af7f28f05a12f70f8 Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 12 Jun 2019 08:10:33 +0800 Subject: Fix #424, refactor merged cells adjuster --- xmlChart.go | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 xmlChart.go (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go old mode 100755 new mode 100644 -- cgit v1.2.1 From dc0869fde3a717009eb4aeff6a26387f0495b655 Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 14 Jun 2019 00:05:10 +0800 Subject: support to create cone, pyramid and cylinder series chart for column and bar types --- xmlChart.go | 1 + 1 file changed, 1 insertion(+) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index d23364c..15c8812 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -324,6 +324,7 @@ type cCharts struct { ScatterStyle *attrValString `xml:"scatterStyle"` VaryColors *attrValBool `xml:"varyColors"` Ser *[]cSer `xml:"ser"` + Shape *attrValString `xml:"shape"` DLbls *cDLbls `xml:"dLbls"` HoleSize *attrValInt `xml:"holeSize"` Smooth *attrValBool `xml:"smooth"` -- cgit v1.2.1 From 5cf1c05ed48ad92b6c58d3dfe7d3598526b77b01 Mon Sep 17 00:00:00 2001 From: xuri Date: Sat, 15 Jun 2019 20:55:56 +0800 Subject: Add surface 3D, wireframe Surface 3D, contour, and wireframe contour chart support --- xmlChart.go | 74 +++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 31 deletions(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index 15c8812..ff28bd3 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -294,26 +294,30 @@ type cView3D struct { RotX *attrValInt `xml:"rotX"` RotY *attrValInt `xml:"rotY"` DepthPercent *attrValInt `xml:"depthPercent"` + Perspective *attrValInt `xml:"perspective"` RAngAx *attrValInt `xml:"rAngAx"` } // cPlotArea directly maps the plotArea element. This element specifies the // plot area of the chart. type cPlotArea struct { - Layout *string `xml:"layout"` - AreaChart *cCharts `xml:"areaChart"` - Area3DChart *cCharts `xml:"area3DChart"` - BarChart *cCharts `xml:"barChart"` - Bar3DChart *cCharts `xml:"bar3DChart"` - DoughnutChart *cCharts `xml:"doughnutChart"` - LineChart *cCharts `xml:"lineChart"` - PieChart *cCharts `xml:"pieChart"` - Pie3DChart *cCharts `xml:"pie3DChart"` - RadarChart *cCharts `xml:"radarChart"` - ScatterChart *cCharts `xml:"scatterChart"` - CatAx []*cAxs `xml:"catAx"` - ValAx []*cAxs `xml:"valAx"` - SpPr *cSpPr `xml:"spPr"` + Layout *string `xml:"layout"` + AreaChart *cCharts `xml:"areaChart"` + Area3DChart *cCharts `xml:"area3DChart"` + BarChart *cCharts `xml:"barChart"` + Bar3DChart *cCharts `xml:"bar3DChart"` + DoughnutChart *cCharts `xml:"doughnutChart"` + LineChart *cCharts `xml:"lineChart"` + PieChart *cCharts `xml:"pieChart"` + Pie3DChart *cCharts `xml:"pie3DChart"` + RadarChart *cCharts `xml:"radarChart"` + ScatterChart *cCharts `xml:"scatterChart"` + Surface3DChart *cCharts `xml:"surface3DChart"` + SurfaceChart *cCharts `xml:"surfaceChart"` + CatAx []*cAxs `xml:"catAx"` + ValAx []*cAxs `xml:"valAx"` + SerAx []*cAxs `xml:"serAx"` + SpPr *cSpPr `xml:"spPr"` } // cCharts specifies the common element of the chart. @@ -323,6 +327,7 @@ type cCharts struct { RadarStyle *attrValString `xml:"radarStyle"` ScatterStyle *attrValString `xml:"scatterStyle"` VaryColors *attrValBool `xml:"varyColors"` + Wireframe *attrValBool `xml:"wireframe"` Ser *[]cSer `xml:"ser"` Shape *attrValString `xml:"shape"` DLbls *cDLbls `xml:"dLbls"` @@ -334,23 +339,29 @@ type cCharts struct { // cAxs directly maps the catAx and valAx element. type cAxs struct { - AxID *attrValInt `xml:"axId"` - Scaling *cScaling `xml:"scaling"` - Delete *attrValBool `xml:"delete"` - AxPos *attrValString `xml:"axPos"` - NumFmt *cNumFmt `xml:"numFmt"` - MajorTickMark *attrValString `xml:"majorTickMark"` - MinorTickMark *attrValString `xml:"minorTickMark"` - TickLblPos *attrValString `xml:"tickLblPos"` - SpPr *cSpPr `xml:"spPr"` - TxPr *cTxPr `xml:"txPr"` - CrossAx *attrValInt `xml:"crossAx"` - Crosses *attrValString `xml:"crosses"` - CrossBetween *attrValString `xml:"crossBetween"` - Auto *attrValBool `xml:"auto"` - LblAlgn *attrValString `xml:"lblAlgn"` - LblOffset *attrValInt `xml:"lblOffset"` - NoMultiLvlLbl *attrValBool `xml:"noMultiLvlLbl"` + AxID *attrValInt `xml:"axId"` + Scaling *cScaling `xml:"scaling"` + Delete *attrValBool `xml:"delete"` + AxPos *attrValString `xml:"axPos"` + MajorGridlines *cChartLines `xml:"majorGridlines"` + NumFmt *cNumFmt `xml:"numFmt"` + MajorTickMark *attrValString `xml:"majorTickMark"` + MinorTickMark *attrValString `xml:"minorTickMark"` + TickLblPos *attrValString `xml:"tickLblPos"` + SpPr *cSpPr `xml:"spPr"` + TxPr *cTxPr `xml:"txPr"` + CrossAx *attrValInt `xml:"crossAx"` + Crosses *attrValString `xml:"crosses"` + CrossBetween *attrValString `xml:"crossBetween"` + Auto *attrValBool `xml:"auto"` + LblAlgn *attrValString `xml:"lblAlgn"` + LblOffset *attrValInt `xml:"lblOffset"` + NoMultiLvlLbl *attrValBool `xml:"noMultiLvlLbl"` +} + +// cChartLines directly maps the chart lines content model. +type cChartLines struct { + SpPr *cSpPr `xml:"spPr"` } // cScaling directly maps the scaling element. This element contains @@ -497,6 +508,7 @@ type cPageMargins struct { // formatChartAxis directly maps the format settings of the chart axis. type formatChartAxis struct { Crossing string `json:"crossing"` + MajorGridlines bool `json:"major_grid_lines"` MajorTickMark string `json:"major_tick_mark"` MinorTickMark string `json:"minor_tick_mark"` MinorUnitType string `json:"minor_unit_type"` -- cgit v1.2.1 From e77c462d3f1c29b009186d42832e6d5f42ac069f Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 19 Jun 2019 00:01:18 +0800 Subject: Support to create bubble and 3D bubble chart --- xmlChart.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index ff28bd3..8a3a680 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -306,6 +306,7 @@ type cPlotArea struct { Area3DChart *cCharts `xml:"area3DChart"` BarChart *cCharts `xml:"barChart"` Bar3DChart *cCharts `xml:"bar3DChart"` + BubbleChart *cCharts `xml:"bubbleChart"` DoughnutChart *cCharts `xml:"doughnutChart"` LineChart *cCharts `xml:"lineChart"` PieChart *cCharts `xml:"pieChart"` @@ -323,6 +324,7 @@ type cPlotArea struct { // cCharts specifies the common element of the chart. type cCharts struct { BarDir *attrValString `xml:"barDir"` + BubbleScale *attrValFloat `xml:"bubbleScale"` Grouping *attrValString `xml:"grouping"` RadarStyle *attrValString `xml:"radarStyle"` ScatterStyle *attrValString `xml:"scatterStyle"` @@ -395,6 +397,8 @@ type cSer struct { XVal *cCat `xml:"xVal"` YVal *cVal `xml:"yVal"` Smooth *attrValBool `xml:"smooth"` + BubbleSize *cVal `xml:"bubbleSize"` + Bubble3D *attrValBool `xml:"bubble3D"` } // cMarker (Marker) directly maps the marker element. This element specifies a -- cgit v1.2.1 From 9c70d0ac868f66badf2663cc7b4b3c46d5411131 Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 11 Aug 2019 00:36:14 +0800 Subject: Documentation updated, Go 1.10+ required --- xmlChart.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index 8a3a680..bb4b4bc 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -5,7 +5,7 @@ // Package excelize providing a set of functions that allow you to write to // and read from XLSX files. Support reads and writes XLSX file generated by // Microsoft Excel™ 2007 and later. Support save file without losing original -// charts of XLSX. This library needs Go version 1.8 or later. +// charts of XLSX. This library needs Go version 1.10 or later. package excelize -- cgit v1.2.1 From a34d3b8c86d67d3ad0bc0dbedb69d3b4ebbc210f Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 24 Sep 2019 21:53:19 +0800 Subject: Compatibility improvement --- xmlChart.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index bb4b4bc..19e86e2 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -293,9 +293,10 @@ type cAutoTitleDeleted struct { type cView3D struct { RotX *attrValInt `xml:"rotX"` RotY *attrValInt `xml:"rotY"` + RAngAx *attrValInt `xml:"rAngAx"` DepthPercent *attrValInt `xml:"depthPercent"` Perspective *attrValInt `xml:"perspective"` - RAngAx *attrValInt `xml:"rAngAx"` + ExtLst *xlsxExtLst `xml:"extLst"` } // cPlotArea directly maps the plotArea element. This element specifies the -- cgit v1.2.1 From eb520ae27757d4bca276fa2894bf461d75df9b37 Mon Sep 17 00:00:00 2001 From: xuri Date: Thu, 26 Sep 2019 22:28:14 +0800 Subject: Improve compatibility for charts --- xmlChart.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index 19e86e2..69e119a 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -332,8 +332,8 @@ type cCharts struct { VaryColors *attrValBool `xml:"varyColors"` Wireframe *attrValBool `xml:"wireframe"` Ser *[]cSer `xml:"ser"` - Shape *attrValString `xml:"shape"` DLbls *cDLbls `xml:"dLbls"` + Shape *attrValString `xml:"shape"` HoleSize *attrValInt `xml:"holeSize"` Smooth *attrValBool `xml:"smooth"` Overlap *attrValInt `xml:"overlap"` -- cgit v1.2.1 From 7716968abc1d330492e311504af8951c34fb7520 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 21 Oct 2019 00:04:18 +0800 Subject: Fix #505, support set line width of the line chart --- xmlChart.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index 69e119a..50d0b3e 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -606,8 +606,9 @@ type formatChartSeries struct { Categories string `json:"categories"` Values string `json:"values"` Line struct { - None bool `json:"none"` - Color string `json:"color"` + None bool `json:"none"` + Color string `json:"color"` + Width float64 `json:"width"` } `json:"line"` Marker struct { Type string `json:"type"` -- cgit v1.2.1 From 6abf8bf9723512086f009ca574bde1d6682fc83d Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 27 Oct 2019 14:16:02 +0800 Subject: Resolve #501, support set minor grid lines for the chart --- xmlChart.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index 50d0b3e..a02da2a 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -347,6 +347,7 @@ type cAxs struct { Delete *attrValBool `xml:"delete"` AxPos *attrValString `xml:"axPos"` MajorGridlines *cChartLines `xml:"majorGridlines"` + MinorGridlines *cChartLines `xml:"minorGridlines"` NumFmt *cNumFmt `xml:"numFmt"` MajorTickMark *attrValString `xml:"majorTickMark"` MinorTickMark *attrValString `xml:"minorTickMark"` @@ -514,6 +515,7 @@ type cPageMargins struct { type formatChartAxis struct { Crossing string `json:"crossing"` MajorGridlines bool `json:"major_grid_lines"` + MinorGridlines bool `json:"minor_grid_lines"` MajorTickMark string `json:"major_tick_mark"` MinorTickMark string `json:"minor_tick_mark"` MinorUnitType string `json:"minor_unit_type"` -- cgit v1.2.1 From 4e4a5b9b3e052d1694442515492792fb1aa74c5a Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 23 Dec 2019 00:07:40 +0800 Subject: Improve compatibility, fix workbook's rels ID calc error --- xmlChart.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index a02da2a..84c1a3b 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -141,25 +141,25 @@ type aSchemeClr struct { // attrValInt directly maps the val element with integer data type as an // attribute。 type attrValInt struct { - Val int `xml:"val,attr"` + Val *int `xml:"val,attr"` } // attrValFloat directly maps the val element with float64 data type as an // attribute。 type attrValFloat struct { - Val float64 `xml:"val,attr"` + Val *float64 `xml:"val,attr"` } // attrValBool directly maps the val element with boolean data type as an // attribute。 type attrValBool struct { - Val bool `xml:"val,attr"` + Val *bool `xml:"val,attr"` } // attrValString directly maps the val element with string data type as an // attribute。 type attrValString struct { - Val string `xml:"val,attr"` + Val *string `xml:"val,attr"` } // aCs directly maps the a:cs element. -- cgit v1.2.1 From 5f3a4bc39f9cf2987104ffe57242a0526cdd9158 Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 25 Dec 2019 00:00:50 +0800 Subject: Fix #538, added setting a major unit and tick label skip support for the chart --- xmlChart.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index 84c1a3b..a28d2a7 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -357,9 +357,13 @@ type cAxs struct { CrossAx *attrValInt `xml:"crossAx"` Crosses *attrValString `xml:"crosses"` CrossBetween *attrValString `xml:"crossBetween"` + MajorUnit *attrValFloat `xml:"majorUnit"` + MinorUnit *attrValFloat `xml:"minorUnit"` Auto *attrValBool `xml:"auto"` LblAlgn *attrValString `xml:"lblAlgn"` LblOffset *attrValInt `xml:"lblOffset"` + TickLblSkip *attrValInt `xml:"tickLblSkip"` + TickMarkSkip *attrValInt `xml:"tickMarkSkip"` NoMultiLvlLbl *attrValBool `xml:"noMultiLvlLbl"` } @@ -519,8 +523,9 @@ type formatChartAxis struct { MajorTickMark string `json:"major_tick_mark"` MinorTickMark string `json:"minor_tick_mark"` MinorUnitType string `json:"minor_unit_type"` - MajorUnit int `json:"major_unit"` + MajorUnit float64 `json:"major_unit"` MajorUnitType string `json:"major_unit_type"` + TickLabelSkip int `json:"tick_label_skip"` DisplayUnits string `json:"display_units"` DisplayUnitsVisible bool `json:"display_units_visible"` DateAxis bool `json:"date_axis"` -- cgit v1.2.1 From 8b960ee1e624bd2776a351a4a3b2ad04c29bae9a Mon Sep 17 00:00:00 2001 From: xuri Date: Sat, 28 Dec 2019 15:05:44 +0800 Subject: Fix #547 and #546, add default overlay element for the chart --- xmlChart.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index a28d2a7..fc38dab 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -56,11 +56,11 @@ type cChart struct { // cTitle (Title) directly maps the title element. This element specifies a // title. type cTitle struct { - Tx cTx `xml:"tx,omitempty"` - Layout string `xml:"layout,omitempty"` - Overlay attrValBool `xml:"overlay,omitempty"` - SpPr cSpPr `xml:"spPr,omitempty"` - TxPr cTxPr `xml:"txPr,omitempty"` + Tx cTx `xml:"tx,omitempty"` + Layout string `xml:"layout,omitempty"` + Overlay *attrValBool `xml:"overlay"` + SpPr cSpPr `xml:"spPr,omitempty"` + TxPr cTxPr `xml:"txPr,omitempty"` } // cTx (Chart Text) directly maps the tx element. This element specifies text -- cgit v1.2.1 From 09485b3f9f0aefc58d51462aed65c2416205c591 Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 29 Dec 2019 16:02:31 +0800 Subject: Improve code coverage unit tests --- xmlChart.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index fc38dab..b6d041e 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // -- cgit v1.2.1 From 9ddb52eac4e451f676dabe4eed45ee95fce38eef Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 14 Jan 2020 00:33:36 +0800 Subject: Fix #554, init combo chart support, new chart pie of pie, bar of pie chart support --- xmlChart.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index b6d041e..9d6263f 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -312,6 +312,7 @@ type cPlotArea struct { LineChart *cCharts `xml:"lineChart"` PieChart *cCharts `xml:"pieChart"` Pie3DChart *cCharts `xml:"pie3DChart"` + OfPieChart *cCharts `xml:"ofPieChart"` RadarChart *cCharts `xml:"radarChart"` ScatterChart *cCharts `xml:"scatterChart"` Surface3DChart *cCharts `xml:"surface3DChart"` @@ -329,6 +330,8 @@ type cCharts struct { Grouping *attrValString `xml:"grouping"` RadarStyle *attrValString `xml:"radarStyle"` ScatterStyle *attrValString `xml:"scatterStyle"` + OfPieType *attrValString `xml:"ofPieType"` + SerLines *attrValString `xml:"serLines"` VaryColors *attrValBool `xml:"varyColors"` Wireframe *attrValBool `xml:"wireframe"` Ser *[]cSer `xml:"ser"` @@ -590,10 +593,11 @@ type formatChart struct { } `json:"fill"` Layout formatLayout `json:"layout"` } `json:"plotarea"` - ShowBlanksAs string `json:"show_blanks_as"` - ShowHiddenData bool `json:"show_hidden_data"` - SetRotation int `json:"set_rotation"` - SetHoleSize int `json:"set_hole_size"` + ShowBlanksAs string `json:"show_blanks_as"` + ShowHiddenData bool `json:"show_hidden_data"` + SetRotation int `json:"set_rotation"` + SetHoleSize int `json:"set_hole_size"` + Combo *formatChart `json:"combo"` } // formatChartLegend directly maps the format settings of the chart legend. -- cgit v1.2.1 From fa7078f06c82ed30f9573caf3c4d24d49f45df5a Mon Sep 17 00:00:00 2001 From: xuri Date: Thu, 16 Jan 2020 01:05:22 +0800 Subject: Specified combo chart as variadic parameters --- xmlChart.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index 9d6263f..5511469 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -593,11 +593,11 @@ type formatChart struct { } `json:"fill"` Layout formatLayout `json:"layout"` } `json:"plotarea"` - ShowBlanksAs string `json:"show_blanks_as"` - ShowHiddenData bool `json:"show_hidden_data"` - SetRotation int `json:"set_rotation"` - SetHoleSize int `json:"set_hole_size"` - Combo *formatChart `json:"combo"` + ShowBlanksAs string `json:"show_blanks_as"` + ShowHiddenData bool `json:"show_hidden_data"` + SetRotation int `json:"set_rotation"` + SetHoleSize int `json:"set_hole_size"` + order int } // formatChartLegend directly maps the format settings of the chart legend. -- cgit v1.2.1 From e2bd08c9111b0141c66adf232edb2fd729afa63f Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 21 Jan 2020 23:29:56 +0800 Subject: Make DeleteChart delete multiple charts located on the same cell --- xmlChart.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index 5511469..8d24552 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -331,10 +331,10 @@ type cCharts struct { RadarStyle *attrValString `xml:"radarStyle"` ScatterStyle *attrValString `xml:"scatterStyle"` OfPieType *attrValString `xml:"ofPieType"` - SerLines *attrValString `xml:"serLines"` VaryColors *attrValBool `xml:"varyColors"` Wireframe *attrValBool `xml:"wireframe"` Ser *[]cSer `xml:"ser"` + SerLines *attrValString `xml:"serLines"` DLbls *cDLbls `xml:"dLbls"` Shape *attrValString `xml:"shape"` HoleSize *attrValInt `xml:"holeSize"` -- cgit v1.2.1 From 9e2318cefa4ebaa7bf6b1dbc95b30ad7a32366b1 Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 10 Mar 2020 00:04:23 +0800 Subject: Resolve #470, export Style structs to allow create the style for cells by given JSON or structure --- xmlChart.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index 8d24552..03b47a1 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -604,7 +604,7 @@ type formatChart struct { type formatChartLegend struct { None bool `json:"none"` DeleteSeries []int `json:"delete_series"` - Font formatFont `json:"font"` + Font Font `json:"font"` Layout formatLayout `json:"layout"` Position string `json:"position"` ShowLegendEntry bool `json:"show_legend_entry"` -- cgit v1.2.1