unioffice/chart/chart.go

645 lines
58 KiB
Go
Raw Normal View History

//
2020-08-23 14:15:53 +00:00
// Copyright 2020 FoxyUtils ehf. All rights reserved.
//
// This is a commercial product and requires a license to operate.
// A trial license can be obtained at https://unidoc.io
//
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
//
// Use of this source code is governed by the UniDoc End User License Agreement
// terms that can be accessed at https://unidoc.io/eula/
2024-10-17 17:05:28 +00:00
package chart ;import (_ad "fmt";_f "github.com/unidoc/unioffice";_b "github.com/unidoc/unioffice/color";_fg "github.com/unidoc/unioffice/drawing";_e "github.com/unidoc/unioffice/measurement";_g "github.com/unidoc/unioffice/schema/soo/dml";_d "github.com/unidoc/unioffice/schema/soo/dml/chart";
_ea "math/rand";);
2020-08-23 14:15:53 +00:00
2024-10-17 17:05:28 +00:00
// SetLabelReference is used to set the source data to a range of cells
// containing strings.
func (_caa CategoryAxisDataSource )SetLabelReference (s string ){_caa ._edf .Choice =_d .NewCT_AxDataSourceChoice ();_caa ._edf .Choice .StrRef =_d .NewCT_StrRef ();_caa ._edf .Choice .StrRef .F =s ;};
2024-10-17 17:05:28 +00:00
// SetDisplayBlanksAs controls how missing values are displayed.
func (_fag Chart )SetDisplayBlanksAs (v _d .ST_DispBlanksAs ){_fag ._fgdc .Chart .DispBlanksAs =_d .NewCT_DispBlanksAs ();_fag ._fgdc .Chart .DispBlanksAs .ValAttr =v ;};func MakeValueAxis (x *_d .CT_ValAx )ValueAxis {return ValueAxis {x }};
2020-08-23 14:15:53 +00:00
2024-10-17 17:05:28 +00:00
// Marker returns the marker properties.
func (_fffb ScatterChartSeries )Marker ()Marker {if _fffb ._bfef .Marker ==nil {_fffb ._bfef .Marker =_d .NewCT_Marker ();};return MakeMarker (_fffb ._bfef .Marker );};func (_bgbb DataLabels )SetShowPercent (b bool ){_bgbb .ensureChoice ();_bgbb ._agea .Choice .ShowPercent =_d .NewCT_Boolean ();
_bgbb ._agea .Choice .ShowPercent .ValAttr =_f .Bool (b );};
2023-08-06 17:57:53 +00:00
2024-10-17 17:05:28 +00:00
// ScatterChartSeries is the data series for a scatter chart.
type ScatterChartSeries struct{_bfef *_d .CT_ScatterSer };func MakeLegend (l *_d .CT_Legend )Legend {return Legend {l }};type CategoryAxis struct{_fb *_d .CT_CatAx };
2022-04-09 14:27:46 +00:00
2024-10-17 17:05:28 +00:00
// AddAxis adds an axis to a Scatter chart.
func (_dgfa ScatterChart )AddAxis (axis Axis ){_aaa :=_d .NewCT_UnsignedInt ();_aaa .ValAttr =axis .AxisID ();_dgfa ._cad .AxId =append (_dgfa ._cad .AxId ,_aaa );};
2021-09-22 16:41:01 +00:00
2024-10-17 17:05:28 +00:00
// InitializeDefaults the bar chart to its defaults
func (_effe PieOfPieChart )InitializeDefaults (){_effe ._gaad .VaryColors =_d .NewCT_Boolean ();_effe ._gaad .VaryColors .ValAttr =_f .Bool (true );_effe .SetType (_d .ST_OfPieTypePie );_effe ._gaad .SecondPieSize =_d .NewCT_SecondPieSize ();_effe ._gaad .SecondPieSize .ValAttr =&_d .ST_SecondPieSize {};
_effe ._gaad .SecondPieSize .ValAttr .ST_SecondPieSizeUShort =_f .Uint16 (75);_ccf :=_d .NewCT_ChartLines ();_ccf .SpPr =_g .NewCT_ShapeProperties ();_fbgb :=_fg .MakeShapeProperties (_ccf .SpPr );_fbgb .LineProperties ().SetSolidFill (_b .Auto );_effe ._gaad .SerLines =append (_effe ._gaad .SerLines ,_ccf );
2024-09-16 09:59:58 +00:00
};
2023-06-10 07:12:37 +00:00
2024-10-17 17:05:28 +00:00
// SetText sets the series text
func (_gadd SurfaceChartSeries )SetText (s string ){_gadd ._dfgf .Tx =_d .NewCT_SerTx ();_gadd ._dfgf .Tx .Choice .V =&s ;};
2021-01-04 16:11:39 +00:00
2024-10-17 17:05:28 +00:00
// BarChart is a 2D bar chart.
type BarChart struct{chartBase ;_ce *_d .CT_BarChart ;};
2024-05-04 18:48:06 +00:00
2024-10-17 17:05:28 +00:00
// SetIndex sets the index of the series
func (_bfgg SurfaceChartSeries )SetIndex (idx uint32 ){_bfgg ._dfgf .Idx .ValAttr =idx };
2023-09-16 17:56:36 +00:00
2024-10-17 17:05:28 +00:00
// AreaChart is an area chart that has a shaded area underneath a curve.
type AreaChart struct{chartBase ;_ac *_d .CT_AreaChart ;};
2023-12-12 23:20:29 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to an Doughnut chart.
func (_deb DoughnutChart )AddSeries ()PieChartSeries {_dbe :=_d .NewCT_PieSer ();_deb ._ggf .Ser =append (_deb ._ggf .Ser ,_dbe );_dbe .Idx .ValAttr =uint32 (len (_deb ._ggf .Ser )-1);_dbe .Order .ValAttr =uint32 (len (_deb ._ggf .Ser )-1);_dgf :=PieChartSeries {_dbe };
_dgf .InitializeDefaults ();return _dgf ;};func (_fbg DataLabels )ensureChoice (){if _fbg ._agea .Choice ==nil {_fbg ._agea .Choice =_d .NewCT_DLblsChoice ();};};
2021-04-23 20:00:00 +00:00
2024-10-17 17:05:28 +00:00
// InitializeDefaults the Bubble chart to its defaults
func (_bc BubbleChart )InitializeDefaults (){};func (_agd NumberDataSource )ensureChoice (){if _agd ._baac .Choice ==nil {_agd ._baac .Choice =_d .NewCT_NumDataSourceChoice ();};};func (_gef CategoryAxis )SetPosition (p _d .ST_AxPos ){_gef ._fb .AxPos =_d .NewCT_AxPos ();
_gef ._fb .AxPos .ValAttr =p ;};
2024-10-17 17:05:28 +00:00
// AddRadarChart adds a new radar chart to a chart.
func (_ggb Chart )AddRadarChart ()RadarChart {_dda :=_d .NewCT_PlotAreaChoice ();_ggb ._fgdc .Chart .PlotArea .Choice =append (_ggb ._fgdc .Chart .PlotArea .Choice ,_dda );_dda .RadarChart =_d .NewCT_RadarChart ();_bga :=RadarChart {_ebg :_dda .RadarChart };
_bga .InitializeDefaults ();return _bga ;};func (_ec Bar3DChart )AddAxis (axis Axis ){_fe :=_d .NewCT_UnsignedInt ();_fe .ValAttr =axis .AxisID ();_ec ._acf .AxId =append (_ec ._acf .AxId ,_fe );};
2021-08-23 20:44:48 +00:00
2024-09-16 09:59:58 +00:00
// X returns the inner wrapped XML type.
2024-10-17 17:05:28 +00:00
func (_ebed Marker )X ()*_d .CT_Marker {return _ebed ._gaf };
2024-07-28 07:48:26 +00:00
2024-10-17 17:05:28 +00:00
// Labels returns the data label properties.
func (_daf LineChartSeries )Labels ()DataLabels {if _daf ._dffa .DLbls ==nil {_daf ._dffa .DLbls =_d .NewCT_DLbls ();};return MakeDataLabels (_daf ._dffa .DLbls );};
2024-07-28 07:48:26 +00:00
2024-10-17 17:05:28 +00:00
// InitializeDefaults the bar chart to its defaults
func (_dad BarChart )InitializeDefaults (){_dad .SetDirection (_d .ST_BarDirCol )};func (_caac RadarChart )AddAxis (axis Axis ){_fecf :=_d .NewCT_UnsignedInt ();_fecf .ValAttr =axis .AxisID ();_caac ._ebg .AxId =append (_caac ._ebg .AxId ,_fecf );};
2023-06-10 07:12:37 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_bba Surface3DChart )X ()*_d .CT_Surface3DChart {return _bba ._def };func MakeCategoryAxis (x *_d .CT_CatAx )CategoryAxis {return CategoryAxis {x }};func (_cde ScatterChart )InitializeDefaults (){_cde ._cad .ScatterStyle .ValAttr =_d .ST_ScatterStyleMarker ;
2024-07-28 07:48:26 +00:00
};
2023-06-10 07:12:37 +00:00
2024-10-17 17:05:28 +00:00
// BubbleChart is a 2D Bubble chart.
type BubbleChart struct{chartBase ;_ba *_d .CT_BubbleChart ;};func (_ebd DataLabels )SetShowLegendKey (b bool ){_ebd .ensureChoice ();_ebd ._agea .Choice .ShowLegendKey =_d .NewCT_Boolean ();_ebd ._agea .Choice .ShowLegendKey .ValAttr =_f .Bool (b );};
func (_cfa DataLabels )SetShowCategoryName (b bool ){_cfa .ensureChoice ();_cfa ._agea .Choice .ShowCatName =_d .NewCT_Boolean ();_cfa ._agea .Choice .ShowCatName .ValAttr =_f .Bool (b );};
2023-07-04 11:04:03 +00:00
2024-10-17 17:05:28 +00:00
// SetOrder sets the order of the series
func (_ebe LineChartSeries )SetOrder (idx uint32 ){_ebe ._dffa .Order .ValAttr =idx };
2024-05-04 18:48:06 +00:00
2024-10-17 17:05:28 +00:00
// CategoryAxis returns the category data source.
func (_gaa BarChartSeries )CategoryAxis ()CategoryAxisDataSource {if _gaa ._ffe .Cat ==nil {_gaa ._ffe .Cat =_d .NewCT_AxDataSource ();};return MakeAxisDataSource (_gaa ._ffe .Cat );};type ValueAxis struct{_aca *_d .CT_ValAx };
2023-03-01 18:42:44 +00:00
2024-10-17 17:05:28 +00:00
// Properties returns the chart's shape properties.
func (_fbc Chart )Properties ()_fg .ShapeProperties {if _fbc ._fgdc .SpPr ==nil {_fbc ._fgdc .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_fbc ._fgdc .SpPr );};
2022-02-05 13:05:36 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_ddec RadarChart )X ()*_d .CT_RadarChart {return _ddec ._ebg };
2022-02-05 13:05:36 +00:00
2024-10-17 17:05:28 +00:00
// Properties returns the bar chart series shape properties.
func (_cbb PieChartSeries )Properties ()_fg .ShapeProperties {if _cbb ._eba .SpPr ==nil {_cbb ._eba .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_cbb ._eba .SpPr );};func (_cgd Title )RunProperties ()_fg .RunProperties {if _cgd ._debb .Tx ==nil {_cgd .SetText ("");
};if _cgd ._debb .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr ==nil {_cgd ._debb .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr =_g .NewCT_TextCharacterProperties ();};return _fg .MakeRunProperties (_cgd ._debb .Tx .Choice .Rich .P [0].EG_TextRun [0].R .RPr );
};
2021-08-23 20:44:48 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to a line chart.
func (_ecg LineChart )AddSeries ()LineChartSeries {_bgfe :=_ecg .nextColor (len (_ecg ._aedf .Ser ));_fcdb :=_d .NewCT_LineSer ();_ecg ._aedf .Ser =append (_ecg ._aedf .Ser ,_fcdb );_fcdb .Idx .ValAttr =uint32 (len (_ecg ._aedf .Ser )-1);_fcdb .Order .ValAttr =uint32 (len (_ecg ._aedf .Ser )-1);
_fgb :=LineChartSeries {_fcdb };_fgb .InitializeDefaults ();_fgb .Properties ().LineProperties ().SetSolidFill (_bgfe );return _fgb ;};
2021-08-23 20:44:48 +00:00
2024-10-17 17:05:28 +00:00
// SetDirection changes the direction of the bar chart (bar or column).
func (_bb BarChart )SetDirection (d _d .ST_BarDir ){_bb ._ce .BarDir .ValAttr =d };func (_acfa GridLines )Properties ()_fg .ShapeProperties {if _acfa ._fbcf .SpPr ==nil {_acfa ._fbcf .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_acfa ._fbcf .SpPr );
};
2023-07-04 11:04:03 +00:00
2024-10-17 17:05:28 +00:00
// AddLine3DChart adds a new 3D line chart to a chart.
func (_ee Chart )AddLine3DChart ()Line3DChart {_fba (_ee ._fgdc .Chart );_aa :=_d .NewCT_PlotAreaChoice ();_ee ._fgdc .Chart .PlotArea .Choice =append (_ee ._fgdc .Chart .PlotArea .Choice ,_aa );_aa .Line3DChart =_d .NewCT_Line3DChart ();_aa .Line3DChart .Grouping =_d .NewCT_Grouping ();
_aa .Line3DChart .Grouping .ValAttr =_d .ST_GroupingStandard ;return Line3DChart {_gaac :_aa .Line3DChart };};func (_ffa DateAxis )Properties ()_fg .ShapeProperties {if _ffa ._fgfc .SpPr ==nil {_ffa ._fgfc .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_ffa ._fgfc .SpPr );
};
2023-09-16 17:56:36 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_bdd SurfaceChart )X ()*_d .CT_SurfaceChart {return _bdd ._bcd };
2023-09-16 17:56:36 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_fca LineChartSeries )X ()*_d .CT_LineSer {return _fca ._dffa };
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_aeb PieChartSeries )X ()*_d .CT_PieSer {return _aeb ._eba };
2024-09-16 09:59:58 +00:00
2024-10-17 17:05:28 +00:00
// SetType sets the type the secone pie to either pie or bar
func (_gfab PieOfPieChart )SetType (t _d .ST_OfPieType ){_gfab ._gaad .OfPieType .ValAttr =t };func (_ge CategoryAxis )InitializeDefaults (){_ge .SetPosition (_d .ST_AxPosB );_ge .SetMajorTickMark (_d .ST_TickMarkOut );_ge .SetMinorTickMark (_d .ST_TickMarkIn );
_ge .SetTickLabelPosition (_d .ST_TickLblPosNextTo );_ge .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_b .LightGray );_ge .Properties ().LineProperties ().SetSolidFill (_b .Black );};
2024-07-28 07:48:26 +00:00
2024-10-17 17:05:28 +00:00
// SetDirection changes the direction of the bar chart (bar or column).
func (_cdd Bar3DChart )SetDirection (d _d .ST_BarDir ){_cdd ._acf .BarDir .ValAttr =d };
2021-06-16 07:10:52 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to a Surface chart.
func (_egbcb Surface3DChart )AddSeries ()SurfaceChartSeries {_cgg :=_egbcb .nextColor (len (_egbcb ._def .Ser ));_defb :=_d .NewCT_SurfaceSer ();_egbcb ._def .Ser =append (_egbcb ._def .Ser ,_defb );_defb .Idx .ValAttr =uint32 (len (_egbcb ._def .Ser )-1);
_defb .Order .ValAttr =uint32 (len (_egbcb ._def .Ser )-1);_bgfb :=SurfaceChartSeries {_defb };_bgfb .InitializeDefaults ();_bgfb .Properties ().LineProperties ().SetSolidFill (_cgg );return _bgfb ;};
2024-05-04 18:48:06 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_dag PieOfPieChart )X ()*_d .CT_OfPieChart {return _dag ._gaad };
2024-09-16 09:59:58 +00:00
2024-10-17 17:05:28 +00:00
// Area3DChart is an area chart that has a shaded area underneath a curve.
type Area3DChart struct{chartBase ;_dd *_d .CT_Area3DChart ;};
2022-06-27 19:44:23 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_ccg Chart )X ()*_d .ChartSpace {return _ccg ._fgdc };func (_fdeeg ScatterChartSeries )InitializeDefaults (){_fdeeg .Properties ().LineProperties ().SetNoFill ();_fdeeg .Marker ().SetSymbol (_d .ST_MarkerStyleAuto );_fdeeg .Labels ().SetShowLegendKey (false );
_fdeeg .Labels ().SetShowValue (true );_fdeeg .Labels ().SetShowPercent (false );_fdeeg .Labels ().SetShowCategoryName (false );_fdeeg .Labels ().SetShowSeriesName (false );_fdeeg .Labels ().SetShowLeaderLines (false );};
2022-09-02 11:46:53 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_dbb Pie3DChart )X ()*_d .CT_Pie3DChart {return _dbb ._geg };func (_egd DataLabels )SetShowValue (b bool ){_egd .ensureChoice ();_egd ._agea .Choice .ShowVal =_d .NewCT_Boolean ();_egd ._agea .Choice .ShowVal .ValAttr =_f .Bool (b );};
2024-09-16 09:59:58 +00:00
2024-10-17 17:05:28 +00:00
// Properties returns the bar chart series shape properties.
func (_cd AreaChartSeries )Properties ()_fg .ShapeProperties {if _cd ._ed .SpPr ==nil {_cd ._ed .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_cd ._ed .SpPr );};func (_cbd SurfaceChartSeries )Values ()NumberDataSource {if _cbd ._dfgf .Val ==nil {_cbd ._dfgf .Val =_d .NewCT_NumDataSource ();
};_add :=MakeNumberDataSource (_cbd ._dfgf .Val );_add .CreateEmptyNumberCache ();return _add ;};
2024-09-16 09:59:58 +00:00
2024-10-17 17:05:28 +00:00
// AddArea3DChart adds a new area chart to a chart.
func (_egg Chart )AddArea3DChart ()Area3DChart {_fba (_egg ._fgdc .Chart );_gdf :=_d .NewCT_PlotAreaChoice ();_egg ._fgdc .Chart .PlotArea .Choice =append (_egg ._fgdc .Chart .PlotArea .Choice ,_gdf );_gdf .Area3DChart =_d .NewCT_Area3DChart ();_agg :=Area3DChart {_dd :_gdf .Area3DChart };
_agg .InitializeDefaults ();return _agg ;};
2023-06-10 07:12:37 +00:00
2024-10-17 17:05:28 +00:00
// Marker returns the marker properties.
func (_adb LineChartSeries )Marker ()Marker {if _adb ._dffa .Marker ==nil {_adb ._dffa .Marker =_d .NewCT_Marker ();};return MakeMarker (_adb ._dffa .Marker );};
2024-09-16 09:59:58 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to a Stock chart.
func (_bbf StockChart )AddSeries ()LineChartSeries {_adg :=_d .NewCT_LineSer ();_bbf ._ccgg .Ser =append (_bbf ._ccgg .Ser ,_adg );_adg .Idx .ValAttr =uint32 (len (_bbf ._ccgg .Ser )-1);_adg .Order .ValAttr =uint32 (len (_bbf ._ccgg .Ser )-1);_agda :=LineChartSeries {_adg };
_agda .Values ().CreateEmptyNumberCache ();_agda .Properties ().LineProperties ().SetNoFill ();return _agda ;};func (_fd AreaChart )AddAxis (axis Axis ){_aec :=_d .NewCT_UnsignedInt ();_aec .ValAttr =axis .AxisID ();_fd ._ac .AxId =append (_fd ._ac .AxId ,_aec );
};func (_dffd DateAxis )MajorGridLines ()GridLines {if _dffd ._fgfc .MajorGridlines ==nil {_dffd ._fgfc .MajorGridlines =_d .NewCT_ChartLines ();};return GridLines {_dffd ._fgfc .MajorGridlines };};func (_bec CategoryAxis )MajorGridLines ()GridLines {if _bec ._fb .MajorGridlines ==nil {_bec ._fb .MajorGridlines =_d .NewCT_ChartLines ();
};return GridLines {_bec ._fb .MajorGridlines };};type GridLines struct{_fbcf *_d .CT_ChartLines };
2023-08-06 17:57:53 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to a Scatter chart.
func (_bca ScatterChart )AddSeries ()ScatterChartSeries {_ead :=_bca .nextColor (len (_bca ._cad .Ser ));_bfe :=_d .NewCT_ScatterSer ();_bca ._cad .Ser =append (_bca ._cad .Ser ,_bfe );_bfe .Idx .ValAttr =uint32 (len (_bca ._cad .Ser )-1);_bfe .Order .ValAttr =uint32 (len (_bca ._cad .Ser )-1);
_bgba :=ScatterChartSeries {_bfe };_bgba .InitializeDefaults ();_bgba .Marker ().Properties ().LineProperties ().SetSolidFill (_ead );_bgba .Marker ().Properties ().SetSolidFill (_ead );return _bgba ;};
2024-09-16 09:59:58 +00:00
2024-10-17 17:05:28 +00:00
// AddPieOfPieChart adds a new pie chart to a chart.
func (_ecc Chart )AddPieOfPieChart ()PieOfPieChart {_gc :=_d .NewCT_PlotAreaChoice ();_ecc ._fgdc .Chart .PlotArea .Choice =append (_ecc ._fgdc .Chart .PlotArea .Choice ,_gc );_gc .OfPieChart =_d .NewCT_OfPieChart ();_deg :=PieOfPieChart {_gaad :_gc .OfPieChart };
_deg .InitializeDefaults ();return _deg ;};
2024-09-16 09:59:58 +00:00
2024-10-17 17:05:28 +00:00
// RadarChart is an Radar chart that has a shaded Radar underneath a curve.
type RadarChart struct{chartBase ;_ebg *_d .CT_RadarChart ;};func (_gffb chartBase )nextColor (_ega int )_b .Color {return _bae [_ega %len (_bae )]};func (_afd CategoryAxis )SetTickLabelPosition (p _d .ST_TickLblPos ){if p ==_d .ST_TickLblPosUnset {_afd ._fb .TickLblPos =nil ;
}else {_afd ._fb .TickLblPos =_d .NewCT_TickLblPos ();_afd ._fb .TickLblPos .ValAttr =p ;};};
2024-05-04 18:48:06 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to a bar chart.
func (_gd Bar3DChart )AddSeries ()BarChartSeries {_ca :=_gd .nextColor (len (_gd ._acf .Ser ));_ab :=_d .NewCT_BarSer ();_gd ._acf .Ser =append (_gd ._acf .Ser ,_ab );_ab .Idx .ValAttr =uint32 (len (_gd ._acf .Ser )-1);_ab .Order .ValAttr =uint32 (len (_gd ._acf .Ser )-1);
_gge :=BarChartSeries {_ab };_gge .InitializeDefaults ();_gge .Properties ().SetSolidFill (_ca );return _gge ;};
2021-09-22 16:41:01 +00:00
2024-10-17 17:05:28 +00:00
// RemoveLegend removes the legend if the chart has one.
func (_bce Chart )RemoveLegend (){_bce ._fgdc .Chart .Legend =nil };
2024-05-22 00:21:11 +00:00
2024-10-17 17:05:28 +00:00
// Values returns the bubble size data source.
func (_bde BubbleChartSeries )BubbleSizes ()NumberDataSource {if _bde ._eab .BubbleSize ==nil {_bde ._eab .BubbleSize =_d .NewCT_NumDataSource ();};return MakeNumberDataSource (_bde ._eab .BubbleSize );};
2024-05-04 18:48:06 +00:00
2024-10-17 17:05:28 +00:00
// SetText sets the series text.
func (_cgcg PieChartSeries )SetText (s string ){_cgcg ._eba .Tx =_d .NewCT_SerTx ();_cgcg ._eba .Tx .Choice .V =&s ;};func (_fgac SeriesAxis )SetCrosses (axis Axis ){_fgac ._fgc .CrossAx .ValAttr =axis .AxisID ()};func MakeSeriesAxis (x *_d .CT_SerAx )SeriesAxis {return SeriesAxis {x }};
func (_cgb ValueAxis )MajorGridLines ()GridLines {if _cgb ._aca .MajorGridlines ==nil {_cgb ._aca .MajorGridlines =_d .NewCT_ChartLines ();};return GridLines {_cgb ._aca .MajorGridlines };};
2024-09-16 09:59:58 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_efee PieChart )X ()*_d .CT_PieChart {return _efee ._bed };func (_aced ValueAxis )SetMinorTickMark (m _d .ST_TickMark ){if m ==_d .ST_TickMarkUnset {_aced ._aca .MinorTickMark =nil ;}else {_aced ._aca .MinorTickMark =_d .NewCT_TickMark ();_aced ._aca .MinorTickMark .ValAttr =m ;
};};
2024-05-08 13:54:39 +00:00
2024-10-17 17:05:28 +00:00
// SetIndex sets the index of the series
func (_gba ScatterChartSeries )SetIndex (idx uint32 ){_gba ._bfef .Idx .ValAttr =idx };
2024-05-08 13:54:39 +00:00
2024-10-17 17:05:28 +00:00
// CategoryAxisDataSource specifies the data for an axis. It's commonly used with
// SetReference to set the axis data to a range of cells.
type CategoryAxisDataSource struct{_edf *_d .CT_AxDataSource };
2024-05-08 13:54:39 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to an area chart.
func (_gg Area3DChart )AddSeries ()AreaChartSeries {_fa :=_gg .nextColor (len (_gg ._dd .Ser ));_ag :=_d .NewCT_AreaSer ();_gg ._dd .Ser =append (_gg ._dd .Ser ,_ag );_ag .Idx .ValAttr =uint32 (len (_gg ._dd .Ser )-1);_ag .Order .ValAttr =uint32 (len (_gg ._dd .Ser )-1);
_bg :=AreaChartSeries {_ag };_bg .InitializeDefaults ();_bg .Properties ().SetSolidFill (_fa );return _bg ;};
2024-09-16 09:59:58 +00:00
2024-10-17 17:05:28 +00:00
// SetValues is used to set the source data to a set of values.
func (_dff CategoryAxisDataSource )SetValues (v []string ){_dff ._edf .Choice =_d .NewCT_AxDataSourceChoice ();_dff ._edf .Choice .StrLit =_d .NewCT_StrData ();_dff ._edf .Choice .StrLit .PtCount =_d .NewCT_UnsignedInt ();_dff ._edf .Choice .StrLit .PtCount .ValAttr =uint32 (len (v ));
for _dfe ,_ggg :=range v {_dff ._edf .Choice .StrLit .Pt =append (_dff ._edf .Choice .StrLit .Pt ,&_d .CT_StrVal {IdxAttr :uint32 (_dfe ),V :_ggg });};};func (_bfag Legend )SetPosition (p _d .ST_LegendPos ){if p ==_d .ST_LegendPosUnset {_bfag ._bcf .LegendPos =nil ;
}else {_bfag ._bcf .LegendPos =_d .NewCT_LegendPos ();_bfag ._bcf .LegendPos .ValAttr =p ;};};
2024-09-16 09:59:58 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_egb Line3DChart )X ()*_d .CT_Line3DChart {return _egb ._gaac };func (_gfge SeriesAxis )AxisID ()uint32 {return _gfge ._fgc .AxId .ValAttr };func (_abe SeriesAxis )InitializeDefaults (){};
2023-04-15 17:27:31 +00:00
2024-10-17 17:05:28 +00:00
// Order returns the order of the series
func (_afg LineChartSeries )Order ()uint32 {return _afg ._dffa .Order .ValAttr };func (_begd Marker )SetSize (sz uint8 ){_begd ._gaf .Size =_d .NewCT_MarkerSize ();_begd ._gaf .Size .ValAttr =&sz ;};func (_eff Legend )Properties ()_fg .ShapeProperties {if _eff ._bcf .SpPr ==nil {_eff ._bcf .SpPr =_g .NewCT_ShapeProperties ();
};return _fg .MakeShapeProperties (_eff ._bcf .SpPr );};
2023-08-06 17:57:53 +00:00
2024-09-16 09:59:58 +00:00
// X returns the inner wrapped XML type.
2024-10-17 17:05:28 +00:00
func (_dgd LineChart )X ()*_d .CT_LineChart {return _dgd ._aedf };
2020-11-09 01:00:18 +00:00
2024-10-17 17:05:28 +00:00
// SetNumberReference is used to set the source data to a range of cells containing
// numbers.
func (_cddc CategoryAxisDataSource )SetNumberReference (s string ){_cddc ._edf .Choice =_d .NewCT_AxDataSourceChoice ();_cddc ._edf .Choice .NumRef =_d .NewCT_NumRef ();_cddc ._edf .Choice .NumRef .F =s ;};func (_dfc BubbleChart )AddAxis (axis Axis ){_ceg :=_d .NewCT_UnsignedInt ();
_ceg .ValAttr =axis .AxisID ();_dfc ._ba .AxId =append (_dfc ._ba .AxId ,_ceg );};func (_ebb Marker )Properties ()_fg .ShapeProperties {if _ebb ._gaf .SpPr ==nil {_ebb ._gaf .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_ebb ._gaf .SpPr );
};func (_bgbg Marker )SetSymbol (s _d .ST_MarkerStyle ){if s ==_d .ST_MarkerStyleUnset {_bgbg ._gaf .Symbol =nil ;}else {_bgbg ._gaf .Symbol =_d .NewCT_MarkerStyle ();_bgbg ._gaf .Symbol .ValAttr =s ;};};func MakeDataLabels (x *_d .CT_DLbls )DataLabels {return DataLabels {x }};
2020-08-23 14:15:53 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to an Pie3D chart.
func (_dga Pie3DChart )AddSeries ()PieChartSeries {_gfff :=_d .NewCT_PieSer ();_dga ._geg .Ser =append (_dga ._geg .Ser ,_gfff );_gfff .Idx .ValAttr =uint32 (len (_dga ._geg .Ser )-1);_gfff .Order .ValAttr =uint32 (len (_dga ._geg .Ser )-1);_ddc :=PieChartSeries {_gfff };
_ddc .InitializeDefaults ();return _ddc ;};
2020-08-23 14:15:53 +00:00
2024-10-17 17:05:28 +00:00
// SetText sets the series text.
func (_eaf AreaChartSeries )SetText (s string ){_eaf ._ed .Tx =_d .NewCT_SerTx ();_eaf ._ed .Tx .Choice .V =&s ;};
2024-05-04 18:48:06 +00:00
2024-10-17 17:05:28 +00:00
// DoughnutChart is a Doughnut chart.
type DoughnutChart struct{chartBase ;_ggf *_d .CT_DoughnutChart ;};
2023-05-26 09:49:04 +00:00
2024-10-17 17:05:28 +00:00
// SetText sets the series text
func (_bfcg ScatterChartSeries )SetText (s string ){_bfcg ._bfef .Tx =_d .NewCT_SerTx ();_bfcg ._bfef .Tx .Choice .V =&s ;};
2024-05-08 13:54:39 +00:00
2024-10-17 17:05:28 +00:00
// Labels returns the data label properties.
func (_dffe ScatterChartSeries )Labels ()DataLabels {if _dffe ._bfef .DLbls ==nil {_dffe ._bfef .DLbls =_d .NewCT_DLbls ();};return MakeDataLabels (_dffe ._bfef .DLbls );};
2021-03-16 20:51:18 +00:00
2024-10-17 17:05:28 +00:00
// BubbleChartSeries is a series to be used on a Bubble chart.
type BubbleChartSeries struct{_eab *_d .CT_BubbleSer };
2023-08-06 17:57:53 +00:00
2024-10-17 17:05:28 +00:00
// Properties returns the bar chart series shape properties.
func (_eeed RadarChartSeries )Properties ()_fg .ShapeProperties {if _eeed ._bege .SpPr ==nil {_eeed ._bege .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_eeed ._bege .SpPr );};
2020-11-09 01:00:18 +00:00
2024-10-17 17:05:28 +00:00
// AddAxis adds an axis to a Surface chart.
func (_ecd SurfaceChart )AddAxis (axis Axis ){_gga :=_d .NewCT_UnsignedInt ();_gga .ValAttr =axis .AxisID ();_ecd ._bcd .AxId =append (_ecd ._bcd .AxId ,_gga );};
2022-09-02 11:46:53 +00:00
2024-10-17 17:05:28 +00:00
// SetHoleSize controls the hole size in the pie chart and is measured in percent.
func (_cdda DoughnutChart )SetHoleSize (pct uint8 ){if _cdda ._ggf .HoleSize ==nil {_cdda ._ggf .HoleSize =_d .NewCT_HoleSize ();};if _cdda ._ggf .HoleSize .ValAttr ==nil {_cdda ._ggf .HoleSize .ValAttr =&_d .ST_HoleSize {};};_cdda ._ggf .HoleSize .ValAttr .ST_HoleSizeUByte =&pct ;
};
2024-06-20 13:33:45 +00:00
2024-09-16 09:59:58 +00:00
// InitializeDefaults the Stock chart to its defaults
2024-10-17 17:05:28 +00:00
func (_ged StockChart )InitializeDefaults (){_ged ._ccgg .HiLowLines =_d .NewCT_ChartLines ();_ged ._ccgg .UpDownBars =_d .NewCT_UpDownBars ();_ged ._ccgg .UpDownBars .GapWidth =_d .NewCT_GapAmount ();_ged ._ccgg .UpDownBars .GapWidth .ValAttr =&_d .ST_GapAmount {};
_ged ._ccgg .UpDownBars .GapWidth .ValAttr .ST_GapAmountUShort =_f .Uint16 (150);_ged ._ccgg .UpDownBars .UpBars =_d .NewCT_UpDownBar ();_ged ._ccgg .UpDownBars .DownBars =_d .NewCT_UpDownBar ();};
2022-12-06 11:56:49 +00:00
2024-10-17 17:05:28 +00:00
// SetOrder sets the order of the series
func (_ggcb SurfaceChartSeries )SetOrder (idx uint32 ){_ggcb ._dfgf .Order .ValAttr =idx };
2021-09-22 16:41:01 +00:00
2024-10-17 17:05:28 +00:00
// AddStockChart adds a new stock chart.
func (_aed Chart )AddStockChart ()StockChart {_aedc :=_d .NewCT_PlotAreaChoice ();_aed ._fgdc .Chart .PlotArea .Choice =append (_aed ._fgdc .Chart .PlotArea .Choice ,_aedc );_aedc .StockChart =_d .NewCT_StockChart ();_dgb :=StockChart {_ccgg :_aedc .StockChart };
_dgb .InitializeDefaults ();return _dgb ;};func (_dgcc LineChartSeries )InitializeDefaults (){_dgcc .Properties ().LineProperties ().SetWidth (1*_e .Point );_dgcc .Properties ().LineProperties ().SetSolidFill (_b .Black );_dgcc .Properties ().LineProperties ().SetJoin (_fg .LineJoinRound );
_dgcc .Marker ().SetSymbol (_d .ST_MarkerStyleNone );_dgcc .Labels ().SetShowLegendKey (false );_dgcc .Labels ().SetShowValue (false );_dgcc .Labels ().SetShowPercent (false );_dgcc .Labels ().SetShowCategoryName (false );_dgcc .Labels ().SetShowSeriesName (false );
_dgcc .Labels ().SetShowLeaderLines (false );};func MakeMarker (x *_d .CT_Marker )Marker {return Marker {x }};func (_baa CategoryAxis )SetMajorTickMark (m _d .ST_TickMark ){if m ==_d .ST_TickMarkUnset {_baa ._fb .MajorTickMark =nil ;}else {_baa ._fb .MajorTickMark =_d .NewCT_TickMark ();
_baa ._fb .MajorTickMark .ValAttr =m ;};};
2023-09-16 17:56:36 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to an Pie chart.
func (_gad PieChart )AddSeries ()PieChartSeries {_dfga :=_d .NewCT_PieSer ();_gad ._bed .Ser =append (_gad ._bed .Ser ,_dfga );_dfga .Idx .ValAttr =uint32 (len (_gad ._bed .Ser )-1);_dfga .Order .ValAttr =uint32 (len (_gad ._bed .Ser )-1);_gcdg :=PieChartSeries {_dfga };
_gcdg .InitializeDefaults ();return _gcdg ;};
2020-10-12 13:59:12 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to an Pie chart.
func (_aea PieOfPieChart )AddSeries ()PieChartSeries {_dcb :=_d .NewCT_PieSer ();_aea ._gaad .Ser =append (_aea ._gaad .Ser ,_dcb );_dcb .Idx .ValAttr =uint32 (len (_aea ._gaad .Ser )-1);_dcb .Order .ValAttr =uint32 (len (_aea ._gaad .Ser )-1);_gbc :=PieChartSeries {_dcb };
_gbc .InitializeDefaults ();return _gbc ;};
2024-06-20 13:33:45 +00:00
2024-10-17 17:05:28 +00:00
// LineChartSeries is the data series for a line chart.
type LineChartSeries struct{_dffa *_d .CT_LineSer };
2020-08-23 14:15:53 +00:00
2024-05-22 00:21:11 +00:00
// X returns the inner wrapped XML type.
2024-10-17 17:05:28 +00:00
func (_db BubbleChartSeries )X ()*_d .CT_BubbleSer {return _db ._eab };
2023-05-26 09:49:04 +00:00
2024-10-17 17:05:28 +00:00
// AddSurface3DChart adds a new 3D surface chart to a chart.
func (_fcdf Chart )AddSurface3DChart ()Surface3DChart {_ggbe :=_d .NewCT_PlotAreaChoice ();_fcdf ._fgdc .Chart .PlotArea .Choice =append (_fcdf ._fgdc .Chart .PlotArea .Choice ,_ggbe );_ggbe .Surface3DChart =_d .NewCT_Surface3DChart ();_fba (_fcdf ._fgdc .Chart );
_bee :=Surface3DChart {_def :_ggbe .Surface3DChart };_bee .InitializeDefaults ();return _bee ;};
2024-02-17 03:37:07 +00:00
2024-10-17 17:05:28 +00:00
// InitializeDefaults initializes a bar chart series to the default values.
func (_dge BarChartSeries )InitializeDefaults (){};func (_aee ScatterChartSeries )Values ()NumberDataSource {if _aee ._bfef .YVal ==nil {_aee ._bfef .YVal =_d .NewCT_NumDataSource ();};return MakeNumberDataSource (_aee ._bfef .YVal );};
2023-12-28 15:53:06 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to a bar chart.
func (_af BarChart )AddSeries ()BarChartSeries {_bfa :=_af .nextColor (len (_af ._ce .Ser ));_ef :=_d .NewCT_BarSer ();_af ._ce .Ser =append (_af ._ce .Ser ,_ef );_ef .Idx .ValAttr =uint32 (len (_af ._ce .Ser )-1);_ef .Order .ValAttr =uint32 (len (_af ._ce .Ser )-1);
_fad :=BarChartSeries {_ef };_fad .InitializeDefaults ();_fad .Properties ().SetSolidFill (_bfa );return _fad ;};
2022-04-09 14:27:46 +00:00
2024-10-17 17:05:28 +00:00
// AddAreaChart adds a new area chart to a chart.
func (_eae Chart )AddAreaChart ()AreaChart {_age :=_d .NewCT_PlotAreaChoice ();_eae ._fgdc .Chart .PlotArea .Choice =append (_eae ._fgdc .Chart .PlotArea .Choice ,_age );_age .AreaChart =_d .NewCT_AreaChart ();_bdg :=AreaChart {_ac :_age .AreaChart };_bdg .InitializeDefaults ();
return _bdg ;};type NumberDataSource struct{_baac *_d .CT_NumDataSource };func (_gfac Title )InitializeDefaults (){_gfac .SetText ("\u0054\u0069\u0074l\u0065");_gfac .RunProperties ().SetSize (16*_e .Point );_gfac .RunProperties ().SetSolidFill (_b .Black );
_gfac .RunProperties ().SetFont ("\u0043\u0061\u006c\u0069\u0062\u0020\u0072\u0069");_gfac .RunProperties ().SetBold (false );};
2022-04-09 14:27:46 +00:00
2024-10-17 17:05:28 +00:00
// AddScatterChart adds a scatter (X/Y) chart.
func (_dgg Chart )AddScatterChart ()ScatterChart {_fgf :=_d .NewCT_PlotAreaChoice ();_dgg ._fgdc .Chart .PlotArea .Choice =append (_dgg ._fgdc .Chart .PlotArea .Choice ,_fgf );_fgf .ScatterChart =_d .NewCT_ScatterChart ();_bac :=ScatterChart {_cad :_fgf .ScatterChart };
_bac .InitializeDefaults ();return _bac ;};
2023-12-28 15:53:06 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to a Surface chart.
func (_dcgd SurfaceChart )AddSeries ()SurfaceChartSeries {_cfbc :=_dcgd .nextColor (len (_dcgd ._bcd .Ser ));_gbcc :=_d .NewCT_SurfaceSer ();_dcgd ._bcd .Ser =append (_dcgd ._bcd .Ser ,_gbcc );_gbcc .Idx .ValAttr =uint32 (len (_dcgd ._bcd .Ser )-1);_gbcc .Order .ValAttr =uint32 (len (_dcgd ._bcd .Ser )-1);
_accf :=SurfaceChartSeries {_gbcc };_accf .InitializeDefaults ();_accf .Properties ().LineProperties ().SetSolidFill (_cfbc );return _accf ;};func (_aga Area3DChart )AddAxis (axis Axis ){_c :=_d .NewCT_UnsignedInt ();_c .ValAttr =axis .AxisID ();_aga ._dd .AxId =append (_aga ._dd .AxId ,_c );
};
2024-05-08 13:54:39 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_bd Area3DChart )X ()*_d .CT_Area3DChart {return _bd ._dd };
2024-05-08 13:54:39 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to an area chart.
func (_ae AreaChart )AddSeries ()AreaChartSeries {_be :=_ae .nextColor (len (_ae ._ac .Ser ));_gf :=_d .NewCT_AreaSer ();_ae ._ac .Ser =append (_ae ._ac .Ser ,_gf );_gf .Idx .ValAttr =uint32 (len (_ae ._ac .Ser )-1);_gf .Order .ValAttr =uint32 (len (_ae ._ac .Ser )-1);
_da :=AreaChartSeries {_gf };_da .InitializeDefaults ();_da .Properties ().SetSolidFill (_be );return _da ;};
2024-05-22 00:21:11 +00:00
2024-10-17 17:05:28 +00:00
// Surface3DChart is a 3D view of a surface chart.
type Surface3DChart struct{chartBase ;_def *_d .CT_Surface3DChart ;};func (_edd Chart )AddSeriesAxis ()SeriesAxis {_ceca :=_d .NewCT_SerAx ();if _edd ._fgdc .Chart .PlotArea .CChoice ==nil {_edd ._fgdc .Chart .PlotArea .CChoice =_d .NewCT_PlotAreaChoice1 ();
};_ceca .AxId =_d .NewCT_UnsignedInt ();_ceca .AxId .ValAttr =0x7FFFFFFF&_ea .Uint32 ();_edd ._fgdc .Chart .PlotArea .CChoice .SerAx =append (_edd ._fgdc .Chart .PlotArea .CChoice .SerAx ,_ceca );_ceca .Delete =_d .NewCT_Boolean ();_ceca .Delete .ValAttr =_f .Bool (false );
_cef :=MakeSeriesAxis (_ceca );_cef .InitializeDefaults ();return _cef ;};var _bae =[]_b .Color {_b .RGB (0x33,0x66,0xcc),_b .RGB (0xDC,0x39,0x12),_b .RGB (0xFF,0x99,0x00),_b .RGB (0x10,0x96,0x18),_b .RGB (0x99,0x00,0x99),_b .RGB (0x3B,0x3E,0xAC),_b .RGB (0x00,0x99,0xC6),_b .RGB (0xDD,0x44,0x77),_b .RGB (0x66,0xAA,0x00),_b .RGB (0xB8,0x2E,0x2E),_b .RGB (0x31,0x63,0x95),_b .RGB (0x99,0x44,0x99),_b .RGB (0x22,0xAA,0x99),_b .RGB (0xAA,0xAA,0x11),_b .RGB (0x66,0x33,0xCC),_b .RGB (0xE6,0x73,0x00),_b .RGB (0x8B,0x07,0x07),_b .RGB (0x32,0x92,0x62),_b .RGB (0x55,0x74,0xA6),_b .RGB (0x3B,0x3E,0xAC)};
type Legend struct{_bcf *_d .CT_Legend };
2024-10-17 17:05:28 +00:00
// InitializeDefaults the bar chart to its defaults
func (_dde PieChart )InitializeDefaults (){_dde ._bed .VaryColors =_d .NewCT_Boolean ();_dde ._bed .VaryColors .ValAttr =_f .Bool (true );};func (_bgc Legend )SetOverlay (b bool ){_bgc ._bcf .Overlay =_d .NewCT_Boolean ();_bgc ._bcf .Overlay .ValAttr =_f .Bool (b );
};func (_dbg Title )SetText (s string ){if _dbg ._debb .Tx ==nil {_dbg ._debb .Tx =_d .NewCT_Tx ();};if _dbg ._debb .Tx .Choice .Rich ==nil {_dbg ._debb .Tx .Choice .Rich =_g .NewCT_TextBody ();};var _fgace *_g .CT_TextParagraph ;if len (_dbg ._debb .Tx .Choice .Rich .P )==0{_fgace =_g .NewCT_TextParagraph ();
_dbg ._debb .Tx .Choice .Rich .P =[]*_g .CT_TextParagraph {_fgace };}else {_fgace =_dbg ._debb .Tx .Choice .Rich .P [0];};var _afgd *_g .EG_TextRun ;if len (_fgace .EG_TextRun )==0{_afgd =_g .NewEG_TextRun ();_fgace .EG_TextRun =[]*_g .EG_TextRun {_afgd };
}else {_afgd =_fgace .EG_TextRun [0];};if _afgd .R ==nil {_afgd .R =_g .NewCT_RegularTextRun ();};_afgd .R .T =s ;};
2020-08-23 14:15:53 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_eb AreaChart )X ()*_d .CT_AreaChart {return _eb ._ac };func (_cfb Surface3DChart )InitializeDefaults (){_cfb ._def .Wireframe =_d .NewCT_Boolean ();_cfb ._def .Wireframe .ValAttr =_f .Bool (false );_cfb ._def .BandFmts =_d .NewCT_BandFmts ();for _cecd :=0;
_cecd < 15;_cecd ++{_gfga :=_d .NewCT_BandFmt ();_gfga .Idx .ValAttr =uint32 (_cecd );_gfga .SpPr =_g .NewCT_ShapeProperties ();_ccb :=_fg .MakeShapeProperties (_gfga .SpPr );_ccb .SetSolidFill (_cfb .nextColor (_cecd ));_cfb ._def .BandFmts .BandFmt =append (_cfb ._def .BandFmts .BandFmt ,_gfga );
};};
2023-08-06 17:57:53 +00:00
2024-10-17 17:05:28 +00:00
// PieChart is a Pie chart.
type PieChart struct{chartBase ;_bed *_d .CT_PieChart ;};func MakeNumberDataSource (x *_d .CT_NumDataSource )NumberDataSource {return NumberDataSource {x }};
2024-05-22 00:21:11 +00:00
2024-09-16 09:59:58 +00:00
// InitializeDefaults the bar chart to its defaults
2024-10-17 17:05:28 +00:00
func (_fgd Area3DChart )InitializeDefaults (){};
2022-02-25 19:20:45 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_abec SurfaceChartSeries )X ()*_d .CT_SurfaceSer {return _abec ._dfgf };
2020-08-23 14:15:53 +00:00
2024-10-17 17:05:28 +00:00
// SetIndex sets the index of the series
func (_gcg LineChartSeries )SetIndex (idx uint32 ){_gcg ._dffa .Idx .ValAttr =idx };func (_gab Legend )InitializeDefaults (){_gab .SetPosition (_d .ST_LegendPosR );_gab .SetOverlay (false );_gab .Properties ().SetNoFill ();_gab .Properties ().LineProperties ().SetNoFill ();
};
2024-07-28 07:48:26 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_acc GridLines )X ()*_d .CT_ChartLines {return _acc ._fbcf };func (_cecb LineChartSeries )Values ()NumberDataSource {if _cecb ._dffa .Val ==nil {_cecb ._dffa .Val =_d .NewCT_NumDataSource ();};return MakeNumberDataSource (_cecb ._dffa .Val );};
2024-07-28 07:48:26 +00:00
2024-10-17 17:05:28 +00:00
// Values returns the value data source.
func (_eea PieChartSeries )Values ()NumberDataSource {if _eea ._eba .Val ==nil {_eea ._eba .Val =_d .NewCT_NumDataSource ();};return MakeNumberDataSource (_eea ._eba .Val );};
2023-06-10 07:12:37 +00:00
2024-10-17 17:05:28 +00:00
// SetText sets the series text
func (_eca LineChartSeries )SetText (s string ){_eca ._dffa .Tx =_d .NewCT_SerTx ();_eca ._dffa .Tx .Choice .V =&s ;};
2024-07-28 07:48:26 +00:00
2024-10-17 17:05:28 +00:00
// InitializeDefaults initializes an Pie series to the default values.
func (_fgfb PieChartSeries )InitializeDefaults (){};func (_gfa CategoryAxis )SetMinorTickMark (m _d .ST_TickMark ){if m ==_d .ST_TickMarkUnset {_gfa ._fb .MinorTickMark =nil ;}else {_gfa ._fb .MinorTickMark =_d .NewCT_TickMark ();_gfa ._fb .MinorTickMark .ValAttr =m ;
};};func (_abf DateAxis )SetPosition (p _d .ST_AxPos ){_abf ._fgfc .AxPos =_d .NewCT_AxPos ();_abf ._fgfc .AxPos .ValAttr =p ;};
2024-05-22 00:21:11 +00:00
2024-10-17 17:05:28 +00:00
// CategoryAxis returns the category data source.
func (_aaf RadarChartSeries )CategoryAxis ()CategoryAxisDataSource {if _aaf ._bege .Cat ==nil {_aaf ._bege .Cat =_d .NewCT_AxDataSource ();};return MakeAxisDataSource (_aaf ._bege .Cat );};
2024-05-22 00:21:11 +00:00
2024-10-17 17:05:28 +00:00
// CategoryAxis returns the category data source.
func (_ffgd PieChartSeries )CategoryAxis ()CategoryAxisDataSource {if _ffgd ._eba .Cat ==nil {_ffgd ._eba .Cat =_d .NewCT_AxDataSource ();};return MakeAxisDataSource (_ffgd ._eba .Cat );};func (_fdee ScatterChartSeries )SetSmooth (b bool ){_fdee ._bfef .Smooth =_d .NewCT_Boolean ();
_fdee ._bfef .Smooth .ValAttr =&b ;};
2024-07-28 07:48:26 +00:00
2024-10-17 17:05:28 +00:00
// Chart is a generic chart.
type Chart struct{_fgdc *_d .ChartSpace };func (_ff nullAxis )AxisID ()uint32 {return 0};
2024-05-22 00:21:11 +00:00
2024-09-16 09:59:58 +00:00
// InitializeDefaults initializes an area series to the default values.
2024-10-17 17:05:28 +00:00
func (_bgf AreaChartSeries )InitializeDefaults (){};func (_fdca NumberDataSource )SetReference (s string ){_fdca .ensureChoice ();if _fdca ._baac .Choice .NumRef ==nil {_fdca ._baac .Choice .NumRef =_d .NewCT_NumRef ();};_fdca ._baac .Choice .NumRef .F =s ;
};
2024-06-20 13:33:45 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_ga AreaChartSeries )X ()*_d .CT_AreaSer {return _ga ._ed };
2024-07-28 07:48:26 +00:00
2024-09-16 09:59:58 +00:00
// InitializeDefaults the bar chart to its defaults
2024-10-17 17:05:28 +00:00
func (_gcd DoughnutChart )InitializeDefaults (){_gcd ._ggf .VaryColors =_d .NewCT_Boolean ();_gcd ._ggf .VaryColors .ValAttr =_f .Bool (true );_gcd ._ggf .HoleSize =_d .NewCT_HoleSize ();_gcd ._ggf .HoleSize .ValAttr =&_d .ST_HoleSize {};_gcd ._ggf .HoleSize .ValAttr .ST_HoleSizeUByte =_f .Uint8 (50);
};
2024-05-22 00:21:11 +00:00
2024-07-28 07:48:26 +00:00
// X returns the inner wrapped XML type.
2024-10-17 17:05:28 +00:00
func (_ada BarChart )X ()*_d .CT_BarChart {return _ada ._ce };func (_agb ScatterChartSeries )CategoryAxis ()CategoryAxisDataSource {if _agb ._bfef .XVal ==nil {_agb ._bfef .XVal =_d .NewCT_AxDataSource ();};return MakeAxisDataSource (_agb ._bfef .XVal );
};
2023-06-10 07:12:37 +00:00
2024-10-17 17:05:28 +00:00
// InitializeDefaults initializes an Radar series to the default values.
func (_acbb RadarChartSeries )InitializeDefaults (){};
2023-12-28 15:53:06 +00:00
2024-10-17 17:05:28 +00:00
// InitializeDefaults the bar chart to its defaults
func (_cg AreaChart )InitializeDefaults (){};
2023-12-28 15:53:06 +00:00
2024-10-17 17:05:28 +00:00
// Properties returns the Bubble chart series shape properties.
func (_eda BubbleChartSeries )Properties ()_fg .ShapeProperties {if _eda ._eab .SpPr ==nil {_eda ._eab .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_eda ._eab .SpPr );};func MakeChart (x *_d .ChartSpace )Chart {return Chart {x }};
2022-02-25 19:20:45 +00:00
2020-08-31 22:58:25 +00:00
2024-10-17 17:05:28 +00:00
// SetValues sets values directly on a source.
func (_ege NumberDataSource )SetValues (v []float64 ){_ege .ensureChoice ();_ege ._baac .Choice .NumRef =nil ;_ege ._baac .Choice .NumLit =_d .NewCT_NumData ();_ege ._baac .Choice .NumLit .PtCount =_d .NewCT_UnsignedInt ();_ege ._baac .Choice .NumLit .PtCount .ValAttr =uint32 (len (v ));
for _fff ,_ddg :=range v {_ege ._baac .Choice .NumLit .Pt =append (_ege ._baac .Choice .NumLit .Pt ,&_d .CT_NumVal {IdxAttr :uint32 (_fff ),V :_ad .Sprintf ("\u0025\u0067",_ddg )});};};
2020-08-31 22:58:25 +00:00
2024-10-17 17:05:28 +00:00
// MakeAxisDataSource constructs an AxisDataSource wrapper.
func MakeAxisDataSource (x *_d .CT_AxDataSource )CategoryAxisDataSource {return CategoryAxisDataSource {x };};
2021-01-04 16:11:39 +00:00
2024-10-17 17:05:28 +00:00
// Pie3DChart is a Pie3D chart.
type Pie3DChart struct{chartBase ;_geg *_d .CT_Pie3DChart ;};
2024-02-17 03:37:07 +00:00
2024-10-17 17:05:28 +00:00
// Properties returns the bar chart series shape properties.
func (_dfg BarChartSeries )Properties ()_fg .ShapeProperties {if _dfg ._ffe .SpPr ==nil {_dfg ._ffe .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_dfg ._ffe .SpPr );};
2020-08-23 14:15:53 +00:00
2024-09-16 09:59:58 +00:00
// X returns the inner wrapped XML type.
2024-10-17 17:05:28 +00:00
func (_bea RadarChartSeries )X ()*_d .CT_RadarSer {return _bea ._bege };
2024-05-04 18:48:06 +00:00
2024-10-17 17:05:28 +00:00
// SetExplosion sets the value that the segements of the pie are 'exploded' by
func (_bgcb PieChartSeries )SetExplosion (v uint32 ){_bgcb ._eba .Explosion =_d .NewCT_UnsignedInt ();_bgcb ._eba .Explosion .ValAttr =v ;};
2023-04-15 17:27:31 +00:00
2024-10-17 17:05:28 +00:00
// SurfaceChart is a 3D surface chart, viewed from the top-down.
type SurfaceChart struct{chartBase ;_bcd *_d .CT_SurfaceChart ;};type chartBase struct{};
2024-06-20 13:33:45 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_dbc StockChart )X ()*_d .CT_StockChart {return _dbc ._ccgg };
2024-02-17 03:37:07 +00:00
2024-10-17 17:05:28 +00:00
// AddLineChart adds a new line chart to a chart.
func (_baaf Chart )AddLineChart ()LineChart {_ebf :=_d .NewCT_PlotAreaChoice ();_baaf ._fgdc .Chart .PlotArea .Choice =append (_baaf ._fgdc .Chart .PlotArea .Choice ,_ebf );_ebf .LineChart =_d .NewCT_LineChart ();_ebf .LineChart .Grouping =_d .NewCT_Grouping ();
_ebf .LineChart .Grouping .ValAttr =_d .ST_GroupingStandard ;return LineChart {_aedf :_ebf .LineChart };};func (_dgc CategoryAxis )SetCrosses (axis Axis ){_dgc ._fb .Choice =_d .NewEG_AxSharedChoice ();_dgc ._fb .Choice .Crosses =_d .NewCT_Crosses ();_dgc ._fb .Choice .Crosses .ValAttr =_d .ST_CrossesAutoZero ;
_dgc ._fb .CrossAx .ValAttr =axis .AxisID ();};type DataLabels struct{_agea *_d .CT_DLbls };
2024-02-17 03:37:07 +00:00
2024-10-17 17:05:28 +00:00
// BarChartSeries is a series to be used on a bar chart.
type BarChartSeries struct{_ffe *_d .CT_BarSer };
2020-08-23 14:15:53 +00:00
2024-10-17 17:05:28 +00:00
// Properties returns the line chart series shape properties.
func (_aadd LineChartSeries )Properties ()_fg .ShapeProperties {if _aadd ._dffa .SpPr ==nil {_aadd ._dffa .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_aadd ._dffa .SpPr );};
2021-05-31 16:22:30 +00:00
2024-10-17 17:05:28 +00:00
// Values returns the value data source.
func (_agf RadarChartSeries )Values ()NumberDataSource {if _agf ._bege .Val ==nil {_agf ._bege .Val =_d .NewCT_NumDataSource ();};return MakeNumberDataSource (_agf ._bege .Val );};func (_gfg LineChartSeries )CategoryAxis ()CategoryAxisDataSource {if _gfg ._dffa .Cat ==nil {_gfg ._dffa .Cat =_d .NewCT_AxDataSource ();
};return MakeAxisDataSource (_gfg ._dffa .Cat );};
2024-05-08 13:54:39 +00:00
2024-10-17 17:05:28 +00:00
// SetText sets the series text.
func (_edag RadarChartSeries )SetText (s string ){_edag ._bege .Tx =_d .NewCT_SerTx ();_edag ._bege .Tx .Choice .V =&s ;};
2024-05-08 13:54:39 +00:00
2024-10-17 17:05:28 +00:00
// Values returns the value data source.
func (_eg BubbleChartSeries )Values ()NumberDataSource {if _eg ._eab .YVal ==nil {_eg ._eab .YVal =_d .NewCT_NumDataSource ();};return MakeNumberDataSource (_eg ._eab .YVal );};func (_cc CategoryAxis )AxisID ()uint32 {return _cc ._fb .AxId .ValAttr };func (_dgcd StockChart )AddAxis (axis Axis ){_eabc :=_d .NewCT_UnsignedInt ();
_eabc .ValAttr =axis .AxisID ();_dgcd ._ccgg .AxId =append (_dgcd ._ccgg .AxId ,_eabc );};type DateAxis struct{_fgfc *_d .CT_DateAx };
2024-05-08 13:54:39 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_bfc DoughnutChart )X ()*_d .CT_DoughnutChart {return _bfc ._ggf };func (_fagb ValueAxis )Properties ()_fg .ShapeProperties {if _fagb ._aca .SpPr ==nil {_fagb ._aca .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_fagb ._aca .SpPr );
};
2024-06-20 13:33:45 +00:00
2024-10-17 17:05:28 +00:00
// CategoryAxis returns the category data source.
func (_fc AreaChartSeries )CategoryAxis ()CategoryAxisDataSource {if _fc ._ed .Cat ==nil {_fc ._ed .Cat =_d .NewCT_AxDataSource ();};return MakeAxisDataSource (_fc ._ed .Cat );};type SeriesAxis struct{_fgc *_d .CT_SerAx };
2021-05-31 16:22:30 +00:00
2024-10-17 17:05:28 +00:00
// Index returns the index of the series
func (_ced ScatterChartSeries )Index ()uint32 {return _ced ._bfef .Idx .ValAttr };
2023-08-06 17:57:53 +00:00
2024-10-17 17:05:28 +00:00
// AddPieChart adds a new pie chart to a chart.
func (_dcdd Chart )AddPieChart ()PieChart {_agee :=_d .NewCT_PlotAreaChoice ();_dcdd ._fgdc .Chart .PlotArea .Choice =append (_dcdd ._fgdc .Chart .PlotArea .Choice ,_agee );_agee .PieChart =_d .NewCT_PieChart ();_aeg :=PieChart {_bed :_agee .PieChart };
_aeg .InitializeDefaults ();return _aeg ;};func (_fed DataLabels )SetShowSeriesName (b bool ){_fed .ensureChoice ();_fed ._agea .Choice .ShowSerName =_d .NewCT_Boolean ();_fed ._agea .Choice .ShowSerName .ValAttr =_f .Bool (b );};
2021-11-10 11:45:21 +00:00
2024-10-17 17:05:28 +00:00
// Bar3DChart is a 3D bar chart.
type Bar3DChart struct{chartBase ;_acf *_d .CT_Bar3DChart ;};
2021-11-10 11:45:21 +00:00
2024-10-17 17:05:28 +00:00
// AddBar3DChart adds a new 3D bar chart to a chart.
func (_fcd Chart )AddBar3DChart ()Bar3DChart {_fba (_fcd ._fgdc .Chart );_bdc :=_d .NewCT_PlotAreaChoice ();_fcd ._fgdc .Chart .PlotArea .Choice =append (_fcd ._fgdc .Chart .PlotArea .Choice ,_bdc );_bdc .Bar3DChart =_d .NewCT_Bar3DChart ();_bdc .Bar3DChart .Grouping =_d .NewCT_BarGrouping ();
_bdc .Bar3DChart .Grouping .ValAttr =_d .ST_BarGroupingStandard ;_de :=Bar3DChart {_acf :_bdc .Bar3DChart };_de .InitializeDefaults ();return _de ;};
2024-05-04 18:48:06 +00:00
2024-10-17 17:05:28 +00:00
// AddDateAxis adds a value axis to the chart.
func (_efd Chart )AddDateAxis ()DateAxis {_cec :=_d .NewCT_DateAx ();if _efd ._fgdc .Chart .PlotArea .CChoice ==nil {_efd ._fgdc .Chart .PlotArea .CChoice =_d .NewCT_PlotAreaChoice1 ();};_cec .AxId =_d .NewCT_UnsignedInt ();_cec .AxId .ValAttr =0x7FFFFFFF&_ea .Uint32 ();
_efd ._fgdc .Chart .PlotArea .CChoice .DateAx =append (_efd ._fgdc .Chart .PlotArea .CChoice .DateAx ,_cec );_cec .Delete =_d .NewCT_Boolean ();_cec .Delete .ValAttr =_f .Bool (false );_cec .Scaling =_d .NewCT_Scaling ();_cec .Scaling .Orientation =_d .NewCT_Orientation ();
_cec .Scaling .Orientation .ValAttr =_d .ST_OrientationMinMax ;_cec .Choice =&_d .EG_AxSharedChoice {};_cec .Choice .Crosses =_d .NewCT_Crosses ();_cec .Choice .Crosses .ValAttr =_d .ST_CrossesAutoZero ;_fcc :=DateAxis {_cec };_fcc .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_b .LightGray );
_fcc .SetMajorTickMark (_d .ST_TickMarkOut );_fcc .SetMinorTickMark (_d .ST_TickMarkIn );_fcc .SetTickLabelPosition (_d .ST_TickLblPosNextTo );_fcc .Properties ().LineProperties ().SetSolidFill (_b .Black );_fcc .SetPosition (_d .ST_AxPosL );return _fcc ;
};
2024-05-04 18:48:06 +00:00
2024-10-17 17:05:28 +00:00
// AddBarChart adds a new bar chart to a chart.
func (_gb Chart )AddBarChart ()BarChart {_ebfd :=_d .NewCT_PlotAreaChoice ();_gb ._fgdc .Chart .PlotArea .Choice =append (_gb ._fgdc .Chart .PlotArea .Choice ,_ebfd );_ebfd .BarChart =_d .NewCT_BarChart ();_ebfd .BarChart .Grouping =_d .NewCT_BarGrouping ();
_ebfd .BarChart .Grouping .ValAttr =_d .ST_BarGroupingStandard ;_eeb :=BarChart {_ce :_ebfd .BarChart };_eeb .InitializeDefaults ();return _eeb ;};func (_ebgd SurfaceChartSeries )CategoryAxis ()CategoryAxisDataSource {if _ebgd ._dfgf .Cat ==nil {_ebgd ._dfgf .Cat =_d .NewCT_AxDataSource ();
};return MakeAxisDataSource (_ebgd ._dfgf .Cat );};
2020-08-23 14:15:53 +00:00
2024-10-17 17:05:28 +00:00
// InitializeDefaults the bar chart to its defaults
func (_efc Pie3DChart )InitializeDefaults (){_efc ._geg .VaryColors =_d .NewCT_Boolean ();_efc ._geg .VaryColors .ValAttr =_f .Bool (true );};
2024-09-16 09:59:58 +00:00
// X returns the inner wrapped XML type.
2024-10-17 17:05:28 +00:00
func (_egbe ScatterChartSeries )X ()*_d .CT_ScatterSer {return _egbe ._bfef };
2021-01-04 16:11:39 +00:00
2024-10-17 17:05:28 +00:00
// Properties returns the line chart series shape properties.
func (_dbd SurfaceChartSeries )Properties ()_fg .ShapeProperties {if _dbd ._dfgf .SpPr ==nil {_dbd ._dfgf .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_dbd ._dfgf .SpPr );};func (_gee DateAxis )SetMajorTickMark (m _d .ST_TickMark ){if m ==_d .ST_TickMarkUnset {_gee ._fgfc .MajorTickMark =nil ;
}else {_gee ._fgfc .MajorTickMark =_d .NewCT_TickMark ();_gee ._fgfc .MajorTickMark .ValAttr =m ;};};
2023-07-04 11:04:03 +00:00
2024-10-17 17:05:28 +00:00
// AddAxis adds an axis to a line chart.
func (_cfe Line3DChart )AddAxis (axis Axis ){_dadd :=_d .NewCT_UnsignedInt ();_dadd .ValAttr =axis .AxisID ();_cfe ._gaac .AxId =append (_cfe ._gaac .AxId ,_dadd );};
2023-08-06 17:57:53 +00:00
2024-10-17 17:05:28 +00:00
// AddCategoryAxis adds a category axis.
func (_aad Chart )AddCategoryAxis ()CategoryAxis {_afe :=_d .NewCT_CatAx ();if _aad ._fgdc .Chart .PlotArea .CChoice ==nil {_aad ._fgdc .Chart .PlotArea .CChoice =_d .NewCT_PlotAreaChoice1 ();};_afe .AxId =_d .NewCT_UnsignedInt ();_afe .AxId .ValAttr =0x7FFFFFFF&_ea .Uint32 ();
_aad ._fgdc .Chart .PlotArea .CChoice .CatAx =append (_aad ._fgdc .Chart .PlotArea .CChoice .CatAx ,_afe );_afe .Auto =_d .NewCT_Boolean ();_afe .Auto .ValAttr =_f .Bool (true );_afe .Delete =_d .NewCT_Boolean ();_afe .Delete .ValAttr =_f .Bool (false );
_bfg :=MakeCategoryAxis (_afe );_bfg .InitializeDefaults ();return _bfg ;};func (_ggfc ValueAxis )SetPosition (p _d .ST_AxPos ){_ggfc ._aca .AxPos =_d .NewCT_AxPos ();_ggfc ._aca .AxPos .ValAttr =p ;};func (_ceb SurfaceChartSeries )InitializeDefaults (){_ceb .Properties ().LineProperties ().SetWidth (1*_e .Point );
_ceb .Properties ().LineProperties ().SetSolidFill (_b .Black );_ceb .Properties ().LineProperties ().SetJoin (_fg .LineJoinRound );};
2023-12-12 23:20:29 +00:00
2024-10-17 17:05:28 +00:00
// SetText sets the series text.
func (_afc BubbleChartSeries )SetText (s string ){_afc ._eab .Tx =_d .NewCT_SerTx ();_afc ._eab .Tx .Choice .V =&s ;};
2023-12-28 15:53:06 +00:00
2024-10-17 17:05:28 +00:00
// AreaChartSeries is a series to be used on an area chart.
type AreaChartSeries struct{_ed *_d .CT_AreaSer };
2020-08-23 14:15:53 +00:00
2024-10-17 17:05:28 +00:00
// AddPie3DChart adds a new pie chart to a chart.
func (_dcf Chart )AddPie3DChart ()Pie3DChart {_fba (_dcf ._fgdc .Chart );_eef :=_d .NewCT_PlotAreaChoice ();_dcf ._fgdc .Chart .PlotArea .Choice =append (_dcf ._fgdc .Chart .PlotArea .Choice ,_eef );_eef .Pie3DChart =_d .NewCT_Pie3DChart ();_bcg :=Pie3DChart {_geg :_eef .Pie3DChart };
_bcg .InitializeDefaults ();return _bcg ;};
2023-12-28 15:53:06 +00:00
2024-09-16 09:59:58 +00:00
// AddAxis adds an axis to a Surface chart.
2024-10-17 17:05:28 +00:00
func (_ggef Surface3DChart )AddAxis (axis Axis ){_gea :=_d .NewCT_UnsignedInt ();_gea .ValAttr =axis .AxisID ();_ggef ._def .AxId =append (_ggef ._def .AxId ,_gea );};
2021-01-04 16:11:39 +00:00
2024-05-04 18:48:06 +00:00
// X returns the inner wrapped XML type.
2024-10-17 17:05:28 +00:00
func (_afec Legend )X ()*_d .CT_Legend {return _afec ._bcf };func (_bfeb ValueAxis )SetMajorTickMark (m _d .ST_TickMark ){if m ==_d .ST_TickMarkUnset {_bfeb ._aca .MajorTickMark =nil ;}else {_bfeb ._aca .MajorTickMark =_d .NewCT_TickMark ();_bfeb ._aca .MajorTickMark .ValAttr =m ;
};};
2024-05-04 18:48:06 +00:00
2024-10-17 17:05:28 +00:00
// AddSurfaceChart adds a new surface chart to a chart.
func (_acb Chart )AddSurfaceChart ()SurfaceChart {_gec :=_d .NewCT_PlotAreaChoice ();_acb ._fgdc .Chart .PlotArea .Choice =append (_acb ._fgdc .Chart .PlotArea .Choice ,_gec );_gec .SurfaceChart =_d .NewCT_SurfaceChart ();_fba (_acb ._fgdc .Chart );_acb ._fgdc .Chart .View3D .RotX .ValAttr =_f .Int8 (90);
_acb ._fgdc .Chart .View3D .RotY .ValAttr =_f .Uint16 (0);_acb ._fgdc .Chart .View3D .Perspective =_d .NewCT_Perspective ();_acb ._fgdc .Chart .View3D .Perspective .ValAttr =_f .Uint8 (0);_dfd :=SurfaceChart {_bcd :_gec .SurfaceChart };_dfd .InitializeDefaults ();
return _dfd ;};
2023-09-16 17:56:36 +00:00
2024-10-17 17:05:28 +00:00
// AddTitle sets a new title on the chart.
func (_bgb Chart )AddTitle ()Title {_bgb ._fgdc .Chart .Title =_d .NewCT_Title ();_bgb ._fgdc .Chart .Title .Overlay =_d .NewCT_Boolean ();_bgb ._fgdc .Chart .Title .Overlay .ValAttr =_f .Bool (false );_bgb ._fgdc .Chart .AutoTitleDeleted =_d .NewCT_Boolean ();
_bgb ._fgdc .Chart .AutoTitleDeleted .ValAttr =_f .Bool (false );_edaa :=MakeTitle (_bgb ._fgdc .Chart .Title );_edaa .InitializeDefaults ();return _edaa ;};
2021-04-23 20:00:00 +00:00
2024-10-17 17:05:28 +00:00
// AddBubbleChart adds a new bubble chart.
func (_eed Chart )AddBubbleChart ()BubbleChart {_cdc :=_d .NewCT_PlotAreaChoice ();_eed ._fgdc .Chart .PlotArea .Choice =append (_eed ._fgdc .Chart .PlotArea .Choice ,_cdc );_cdc .BubbleChart =_d .NewCT_BubbleChart ();_fdc :=BubbleChart {_ba :_cdc .BubbleChart };
_fdc .InitializeDefaults ();return _fdc ;};func (_gcga ValueAxis )SetCrosses (axis Axis ){_gcga ._aca .CrossAx .ValAttr =axis .AxisID ()};
2021-07-30 17:03:26 +00:00
2024-10-17 17:05:28 +00:00
// CreateEmptyNumberCache creates an empty number cache, which is used sometimes
// to increase file format compatibility. It should actually contain the
// computed cell data, but just creating an empty one is good enough.
func (_ecag NumberDataSource )CreateEmptyNumberCache (){_ecag .ensureChoice ();if _ecag ._baac .Choice .NumRef ==nil {_ecag ._baac .Choice .NumRef =_d .NewCT_NumRef ();};_ecag ._baac .Choice .NumLit =nil ;_ecag ._baac .Choice .NumRef .NumCache =_d .NewCT_NumData ();
_ecag ._baac .Choice .NumRef .NumCache .PtCount =_d .NewCT_UnsignedInt ();_ecag ._baac .Choice .NumRef .NumCache .PtCount .ValAttr =0;};type Line3DChart struct{chartBase ;_gaac *_d .CT_Line3DChart ;};func (_ddd DateAxis )AxisID ()uint32 {return _ddd ._fgfc .AxId .ValAttr };
2021-09-22 16:41:01 +00:00
2022-01-15 21:17:38 +00:00
2024-09-16 09:59:58 +00:00
// InitializeDefaults the bar chart to its defaults
2024-10-17 17:05:28 +00:00
func (_bf Bar3DChart )InitializeDefaults (){_bf .SetDirection (_d .ST_BarDirCol )};
// Values returns the value data source.
func (_cee BarChartSeries )Values ()NumberDataSource {if _cee ._ffe .Val ==nil {_cee ._ffe .Val =_d .NewCT_NumDataSource ();};return MakeNumberDataSource (_cee ._ffe .Val );};
// AddAxis adds an axis to a line chart.
func (_cac LineChart )AddAxis (axis Axis ){_dcg :=_d .NewCT_UnsignedInt ();_dcg .ValAttr =axis .AxisID ();_cac ._aedf .AxId =append (_cac ._aedf .AxId ,_dcg );};
// RadarChartSeries is a series to be used on an Radar chart.
type RadarChartSeries struct{_bege *_d .CT_RadarSer };
2023-06-10 07:12:37 +00:00
2024-07-28 07:48:26 +00:00
// X returns the inner wrapped XML type.
2024-10-17 17:05:28 +00:00
func (_cag BubbleChart )X ()*_d .CT_BubbleChart {return _cag ._ba };
2023-07-04 11:04:03 +00:00
2024-09-16 09:59:58 +00:00
// Index returns the index of the series
2024-10-17 17:05:28 +00:00
func (_cce SurfaceChartSeries )Index ()uint32 {return _cce ._dfgf .Idx .ValAttr };var NullAxis Axis =nullAxis (0);func (_dddc ValueAxis )SetTickLabelPosition (p _d .ST_TickLblPos ){if p ==_d .ST_TickLblPosUnset {_dddc ._aca .TickLblPos =nil ;}else {_dddc ._aca .TickLblPos =_d .NewCT_TickLblPos ();
_dddc ._aca .TickLblPos .ValAttr =p ;};};func (_gdfc DateAxis )SetCrosses (axis Axis ){_gdfc ._fgfc .CrossAx .ValAttr =axis .AxisID ()};func (_egbf Title )ParagraphProperties ()_fg .ParagraphProperties {if _egbf ._debb .Tx ==nil {_egbf .SetText ("");};
if _egbf ._debb .Tx .Choice .Rich .P [0].PPr ==nil {_egbf ._debb .Tx .Choice .Rich .P [0].PPr =_g .NewCT_TextParagraphProperties ();};return _fg .MakeParagraphProperties (_egbf ._debb .Tx .Choice .Rich .P [0].PPr );};
2023-08-06 17:57:53 +00:00
2024-10-17 17:05:28 +00:00
// Values returns the value data source.
func (_beg AreaChartSeries )Values ()NumberDataSource {if _beg ._ed .Val ==nil {_beg ._ed .Val =_d .NewCT_NumDataSource ();};return MakeNumberDataSource (_beg ._ed .Val );};type nullAxis byte ;func (_fab DataLabels )SetShowLeaderLines (b bool ){_fab .ensureChoice ();
_fab ._agea .Choice .ShowLeaderLines =_d .NewCT_Boolean ();_fab ._agea .Choice .ShowLeaderLines .ValAttr =_f .Bool (b );};
2024-05-04 18:48:06 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to an Radar chart.
func (_gadb RadarChart )AddSeries ()RadarChartSeries {_eee :=_gadb .nextColor (len (_gadb ._ebg .Ser ));_gag :=_d .NewCT_RadarSer ();_gadb ._ebg .Ser =append (_gadb ._ebg .Ser ,_gag );_gag .Idx .ValAttr =uint32 (len (_gadb ._ebg .Ser )-1);_gag .Order .ValAttr =uint32 (len (_gadb ._ebg .Ser )-1);
_faa :=RadarChartSeries {_gag };_faa .InitializeDefaults ();_faa .Properties ().SetSolidFill (_eee );return _faa ;};
2022-12-06 11:56:49 +00:00
2024-10-17 17:05:28 +00:00
// CategoryAxis returns the category data source.
func (_ddf BubbleChartSeries )CategoryAxis ()CategoryAxisDataSource {if _ddf ._eab .XVal ==nil {_ddf ._eab .XVal =_d .NewCT_AxDataSource ();};return MakeAxisDataSource (_ddf ._eab .XVal );};
2024-05-04 18:48:06 +00:00
2024-10-17 17:05:28 +00:00
// PieChartSeries is a series to be used on an Pie chart.
type PieChartSeries struct{_eba *_d .CT_PieSer };
2023-12-28 15:53:06 +00:00
2024-10-17 17:05:28 +00:00
// StockChart is a 2D Stock chart.
type StockChart struct{chartBase ;_ccgg *_d .CT_StockChart ;};
2024-05-08 13:54:39 +00:00
2024-09-16 09:59:58 +00:00
// X returns the inner wrapped XML type.
2024-10-17 17:05:28 +00:00
func (_cfg Title )X ()*_d .CT_Title {return _cfg ._debb };
2024-05-08 13:54:39 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_egbc ScatterChart )X ()*_d .CT_ScatterChart {return _egbc ._cad };func (_aaac ValueAxis )AxisID ()uint32 {return _aaac ._aca .AxId .ValAttr };func (_fcg DateAxis )SetMinorTickMark (m _d .ST_TickMark ){if m ==_d .ST_TickMarkUnset {_fcg ._fgfc .MinorTickMark =nil ;
}else {_fcg ._fgfc .MinorTickMark =_d .NewCT_TickMark ();_fcg ._fgfc .MinorTickMark .ValAttr =m ;};};
2023-12-28 15:53:06 +00:00
2024-10-17 17:05:28 +00:00
// AddLegend adds a legend to a chart, replacing any existing legend.
func (_ggc Chart )AddLegend ()Legend {_ggc ._fgdc .Chart .Legend =_d .NewCT_Legend ();_aada :=MakeLegend (_ggc ._fgdc .Chart .Legend );_aada .InitializeDefaults ();return _aada ;};
// RemoveTitle removes any existing title from the chart.
func (_efe Chart )RemoveTitle (){_efe ._fgdc .Chart .Title =nil ;_efe ._fgdc .Chart .AutoTitleDeleted =_d .NewCT_Boolean ();_efe ._fgdc .Chart .AutoTitleDeleted .ValAttr =_f .Bool (true );};
2023-07-04 11:04:03 +00:00
2024-09-16 09:59:58 +00:00
// Axis is the interface implemented by different axes when assigning to a
// chart.
2024-10-17 17:05:28 +00:00
type Axis interface{AxisID ()uint32 ;};func (_fga LineChartSeries )SetSmooth (b bool ){_fga ._dffa .Smooth =_d .NewCT_Boolean ();_fga ._dffa .Smooth .ValAttr =&b ;};
2023-09-16 17:56:36 +00:00
2024-05-08 13:54:39 +00:00
// X returns the inner wrapped XML type.
2024-10-17 17:05:28 +00:00
func (_bda BarChartSeries )X ()*_d .CT_BarSer {return _bda ._ffe };
2023-12-28 15:53:06 +00:00
2024-10-17 17:05:28 +00:00
// AddSeries adds a default series to a Bubble chart.
func (_fec BubbleChart )AddSeries ()BubbleChartSeries {_aba :=_fec .nextColor (len (_fec ._ba .Ser ));_cgc :=_d .NewCT_BubbleSer ();_fec ._ba .Ser =append (_fec ._ba .Ser ,_cgc );_cgc .Idx .ValAttr =uint32 (len (_fec ._ba .Ser )-1);_cgc .Order .ValAttr =uint32 (len (_fec ._ba .Ser )-1);
_ceea :=BubbleChartSeries {_cgc };_ceea .InitializeDefaults ();_ceea .Properties ().SetSolidFill (_aba );return _ceea ;};
2023-12-28 15:53:06 +00:00
2024-10-17 17:05:28 +00:00
// InitializeDefaults the bar chart to its defaults
func (_abae RadarChart )InitializeDefaults (){_abae ._ebg .RadarStyle .ValAttr =_d .ST_RadarStyleMarker };
2024-02-17 03:37:07 +00:00
2024-10-17 17:05:28 +00:00
// InitializeDefaults initializes a Bubble chart series to the default values.
func (_dcd BubbleChartSeries )InitializeDefaults (){};
2023-12-28 15:53:06 +00:00
2024-09-16 09:59:58 +00:00
// X returns the inner wrapped XML type.
2024-10-17 17:05:28 +00:00
func (_ggea ValueAxis )X ()*_d .CT_ValAx {return _ggea ._aca };func MakeTitle (x *_d .CT_Title )Title {return Title {x }};
2024-10-17 17:05:28 +00:00
// Index returns the index of the series
func (_cb LineChartSeries )Index ()uint32 {return _cb ._dffa .Idx .ValAttr };
2024-10-17 17:05:28 +00:00
// AddDoughnutChart adds a new doughnut (pie with a hole in the center) chart to a chart.
func (_cf Chart )AddDoughnutChart ()DoughnutChart {_dbf :=_d .NewCT_PlotAreaChoice ();_cf ._fgdc .Chart .PlotArea .Choice =append (_cf ._fgdc .Chart .PlotArea .Choice ,_dbf );_dbf .DoughnutChart =_d .NewCT_DoughnutChart ();_cgca :=DoughnutChart {_ggf :_dbf .DoughnutChart };
_cgca .InitializeDefaults ();return _cgca ;};func (_bcfc SurfaceChart )InitializeDefaults (){_bcfc ._bcd .Wireframe =_d .NewCT_Boolean ();_bcfc ._bcd .Wireframe .ValAttr =_f .Bool (false );_bcfc ._bcd .BandFmts =_d .NewCT_BandFmts ();for _bcad :=0;_bcad < 15;
_bcad ++{_gca :=_d .NewCT_BandFmt ();_gca .Idx .ValAttr =uint32 (_bcad );_gca .SpPr =_g .NewCT_ShapeProperties ();_bgg :=_fg .MakeShapeProperties (_gca .SpPr );_bgg .SetSolidFill (_bcfc .nextColor (_bcad ));_bcfc ._bcd .BandFmts .BandFmt =append (_bcfc ._bcd .BandFmts .BandFmt ,_gca );
};};
2024-05-08 13:54:39 +00:00
2024-10-17 17:05:28 +00:00
// AddValueAxis adds a value axis to the chart.
func (_ageef Chart )AddValueAxis ()ValueAxis {_fgdf :=_d .NewCT_ValAx ();if _ageef ._fgdc .Chart .PlotArea .CChoice ==nil {_ageef ._fgdc .Chart .PlotArea .CChoice =_d .NewCT_PlotAreaChoice1 ();};_fgdf .AxId =_d .NewCT_UnsignedInt ();_fgdf .AxId .ValAttr =0x7FFFFFFF&_ea .Uint32 ();
_ageef ._fgdc .Chart .PlotArea .CChoice .ValAx =append (_ageef ._fgdc .Chart .PlotArea .CChoice .ValAx ,_fgdf );_fgdf .Delete =_d .NewCT_Boolean ();_fgdf .Delete .ValAttr =_f .Bool (false );_fgdf .Scaling =_d .NewCT_Scaling ();_fgdf .Scaling .Orientation =_d .NewCT_Orientation ();
_fgdf .Scaling .Orientation .ValAttr =_d .ST_OrientationMinMax ;_fgdf .Choice =&_d .EG_AxSharedChoice {};_fgdf .Choice .Crosses =_d .NewCT_Crosses ();_fgdf .Choice .Crosses .ValAttr =_d .ST_CrossesAutoZero ;_fgdf .CrossBetween =_d .NewCT_CrossBetween ();
_fgdf .CrossBetween .ValAttr =_d .ST_CrossBetweenBetween ;_gff :=MakeValueAxis (_fgdf );_gff .MajorGridLines ().Properties ().LineProperties ().SetSolidFill (_b .LightGray );_gff .SetMajorTickMark (_d .ST_TickMarkOut );_gff .SetMinorTickMark (_d .ST_TickMarkIn );
_gff .SetTickLabelPosition (_d .ST_TickLblPosNextTo );_gff .Properties ().LineProperties ().SetSolidFill (_b .Black );_gff .SetPosition (_d .ST_AxPosL );return _gff ;};
2024-06-20 13:33:45 +00:00
2024-10-17 17:05:28 +00:00
// Order returns the order of the series
func (_fee SurfaceChartSeries )Order ()uint32 {return _fee ._dfgf .Order .ValAttr };type Marker struct{_gaf *_d .CT_Marker };func _fba (_feb *_d .CT_Chart ){_feb .View3D =_d .NewCT_View3D ();_feb .View3D .RotX =_d .NewCT_RotX ();_feb .View3D .RotX .ValAttr =_f .Int8 (15);
_feb .View3D .RotY =_d .NewCT_RotY ();_feb .View3D .RotY .ValAttr =_f .Uint16 (20);_feb .View3D .RAngAx =_d .NewCT_Boolean ();_feb .View3D .RAngAx .ValAttr =_f .Bool (false );_feb .Floor =_d .NewCT_Surface ();_feb .Floor .Thickness =_d .NewCT_Thickness ();
_feb .Floor .Thickness .ValAttr .Uint32 =_f .Uint32 (0);_feb .SideWall =_d .NewCT_Surface ();_feb .SideWall .Thickness =_d .NewCT_Thickness ();_feb .SideWall .Thickness .ValAttr .Uint32 =_f .Uint32 (0);_feb .BackWall =_d .NewCT_Surface ();_feb .BackWall .Thickness =_d .NewCT_Thickness ();
_feb .BackWall .Thickness .ValAttr .Uint32 =_f .Uint32 (0);};
2023-12-12 23:20:29 +00:00
2024-10-17 17:05:28 +00:00
// PieOfPieChart is a Pie chart with an extra Pie chart.
type PieOfPieChart struct{chartBase ;_gaad *_d .CT_OfPieChart ;};type LineChart struct{chartBase ;_aedf *_d .CT_LineChart ;};
2023-12-12 23:20:29 +00:00
2024-10-17 17:05:28 +00:00
// SetText sets the series text.
func (_df BarChartSeries )SetText (s string ){_df ._ffe .Tx =_d .NewCT_SerTx ();_df ._ffe .Tx .Choice .V =&s ;};type Title struct{_debb *_d .CT_Title };
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_dc Bar3DChart )X ()*_d .CT_Bar3DChart {return _dc ._acf };func (_cdb DataLabels )SetPosition (p _d .ST_DLblPos ){_cdb .ensureChoice ();_cdb ._agea .Choice .DLblPos =_d .NewCT_DLblPos ();_cdb ._agea .Choice .DLblPos .ValAttr =p ;};func (_dg BarChart )AddAxis (axis Axis ){_ace :=_d .NewCT_UnsignedInt ();
_ace .ValAttr =axis .AxisID ();_dg ._ce .AxId =append (_dg ._ce .AxId ,_ace );};
2024-05-22 00:21:11 +00:00
2024-10-17 17:05:28 +00:00
// Properties returns the line chart series shape properties.
func (_bge ScatterChartSeries )Properties ()_fg .ShapeProperties {if _bge ._bfef .SpPr ==nil {_bge ._bfef .SpPr =_g .NewCT_ShapeProperties ();};return _fg .MakeShapeProperties (_bge ._bfef .SpPr );};
2024-09-16 09:59:58 +00:00
2024-10-17 17:05:28 +00:00
// X returns the inner wrapped XML type.
func (_bfd DateAxis )X ()*_d .CT_DateAx {return _bfd ._fgfc };
2024-09-16 09:59:58 +00:00
// X returns the inner wrapped XML type.
2024-10-17 17:05:28 +00:00
func (_ecagd SeriesAxis )X ()*_d .CT_SerAx {return _ecagd ._fgc };
2024-05-22 00:21:11 +00:00
2024-10-17 17:05:28 +00:00
// Order returns the order of the series
func (_gbd ScatterChartSeries )Order ()uint32 {return _gbd ._bfef .Order .ValAttr };type ScatterChart struct{chartBase ;_cad *_d .CT_ScatterChart ;};type SurfaceChartSeries struct{_dfgf *_d .CT_SurfaceSer };func (_ffg CategoryAxis )Properties ()_fg .ShapeProperties {if _ffg ._fb .SpPr ==nil {_ffg ._fb .SpPr =_g .NewCT_ShapeProperties ();
};return _fg .MakeShapeProperties (_ffg ._fb .SpPr );};
2024-05-22 00:21:11 +00:00
2024-10-17 17:05:28 +00:00
// SetOrder sets the order of the series
func (_ddfc ScatterChartSeries )SetOrder (idx uint32 ){_ddfc ._bfef .Order .ValAttr =idx };func (_bfdf DateAxis )SetTickLabelPosition (p _d .ST_TickLblPos ){if p ==_d .ST_TickLblPosUnset {_bfdf ._fgfc .TickLblPos =nil ;}else {_bfdf ._fgfc .TickLblPos =_d .NewCT_TickLblPos ();
_bfdf ._fgfc .TickLblPos .ValAttr =p ;};};
// AddSeries adds a default series to a line chart.
func (_gcf Line3DChart )AddSeries ()LineChartSeries {_bfb :=_gcf .nextColor (len (_gcf ._gaac .Ser ));_fde :=_d .NewCT_LineSer ();_gcf ._gaac .Ser =append (_gcf ._gaac .Ser ,_fde );_fde .Idx .ValAttr =uint32 (len (_gcf ._gaac .Ser )-1);_fde .Order .ValAttr =uint32 (len (_gcf ._gaac .Ser )-1);
_afdc :=LineChartSeries {_fde };_afdc .InitializeDefaults ();_afdc .Properties ().LineProperties ().SetSolidFill (_bfb );_afdc .Properties ().SetSolidFill (_bfb );return _afdc ;};