@v587d/capital-generation 2.28.0 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/README.md +5 -4
- package/THIRD_PARTY_NOTICES.md +16 -0
- package/automation/package.json +1 -1
- package/chart-ui/package.json +1 -1
- package/config/package.json +1 -1
- package/lib/collector-runtime.js +56 -1
- package/lib/data-collector/catalog-taxonomy.d.ts +1 -1
- package/lib/data-collector/catalog-taxonomy.js +33 -0
- package/lib/data-collector/tools.js +7 -7
- package/lib/host-version.d.ts +9 -0
- package/lib/host-version.js +57 -0
- package/lib/python-runtime/errors.d.ts +1 -1
- package/lib/python-runtime/errors.js +2 -0
- package/lib/python-runtime/manager.d.ts +28 -1
- package/lib/python-runtime/manager.js +141 -5
- package/lib/python-runtime/probe.d.ts +24 -0
- package/lib/python-runtime/probe.js +66 -50
- package/lib/runtime-entry.js +8 -0
- package/lib/sources/csindex-http.d.ts +4 -0
- package/lib/sources/csindex-http.js +233 -0
- package/lib/sources/eastmoney-http.js +1504 -1
- package/lib/sources/fuyao-rest.js +168 -8
- package/lib/sources/official-http.d.ts +4 -0
- package/lib/sources/official-http.js +477 -0
- package/lib/sources/python-remote.d.ts +25 -0
- package/lib/sources/python-remote.js +461 -0
- package/lib/sources/sina-http.d.ts +2 -0
- package/lib/sources/sina-http.js +484 -0
- package/lib/sources/tencent-http.js +23 -8
- package/lib/sources/ths-http.d.ts +2 -0
- package/lib/sources/ths-http.js +514 -0
- package/lib/time/tools.js +19 -0
- package/lib/web-retriever/local-fetch.d.ts +1 -1
- package/lib/web-retriever/local-fetch.js +1 -1
- package/lib/web-retriever/sources.d.ts +7 -0
- package/lib/web-retriever/sources.js +46 -21
- package/lib/web-retriever/throttle.d.ts +8 -0
- package/lib/web-retriever/throttle.js +13 -0
- package/lib/web-retriever/tools.js +1 -1
- package/lib/web-retriever/wind-client.d.ts +1 -1
- package/lib/web-retriever/wind-client.js +1 -1
- package/package.json +6 -3
- package/preset/capital-generation/agent.patch.yml +7 -5
- package/preset/capital-generation/skills/capital-data-protocol/SKILL.md +16 -16
- package/python/scripts/baostock_stock_basic.py +129 -0
- package/python/scripts/baostock_valuation_history.py +141 -0
- package/python/scripts/pbc_social_financing.py +291 -0
- package/python/vendor/baostock/LICENSE +19 -0
- package/python/vendor/baostock/__init__.py +42 -0
- package/python/vendor/baostock/common/__init__.py +0 -0
- package/python/vendor/baostock/common/contants.py +189 -0
- package/python/vendor/baostock/common/context.py +4 -0
- package/python/vendor/baostock/corpreport/__init__.py +0 -0
- package/python/vendor/baostock/corpreport/corp_performance.py +202 -0
- package/python/vendor/baostock/data/__init__.py +0 -0
- package/python/vendor/baostock/data/messageheader.py +17 -0
- package/python/vendor/baostock/data/msg.py +21 -0
- package/python/vendor/baostock/data/resultset.py +200 -0
- package/python/vendor/baostock/demo/__init__.py +0 -0
- package/python/vendor/baostock/demo/demo_A_stock_5mk-data.py +34 -0
- package/python/vendor/baostock/demo/demo_A_stock_k_data.py +36 -0
- package/python/vendor/baostock/demo/demo_AllStock.py +27 -0
- package/python/vendor/baostock/demo/demo_Balance_data.py +22 -0
- package/python/vendor/baostock/demo/demo_CashFlow_data.py +22 -0
- package/python/vendor/baostock/demo/demo_Dividend_data.py +35 -0
- package/python/vendor/baostock/demo/demo_Dupont_data.py +25 -0
- package/python/vendor/baostock/demo/demo_Forecast_report.py +24 -0
- package/python/vendor/baostock/demo/demo_Growth_data.py +22 -0
- package/python/vendor/baostock/demo/demo_Index_k_data.py +39 -0
- package/python/vendor/baostock/demo/demo_Operation_data.py +22 -0
- package/python/vendor/baostock/demo/demo_PerformanceExpress_report.py +25 -0
- package/python/vendor/baostock/demo/demo_Profit_data.py +22 -0
- package/python/vendor/baostock/demo/demo_TradeDates.py +27 -0
- package/python/vendor/baostock/demo/demo_adjust_factor_data.py +23 -0
- package/python/vendor/baostock/demo/demo_assignDayData.py +23 -0
- package/python/vendor/baostock/demo/demo_daily_adjust_factor_data.py +28 -0
- package/python/vendor/baostock/demo/demo_daily_k_4_AStock.py +28 -0
- package/python/vendor/baostock/demo/demo_daily_k_4_ETF.py +28 -0
- package/python/vendor/baostock/demo/demo_depositRate_data.py +26 -0
- package/python/vendor/baostock/demo/demo_hs300_stocks.py +26 -0
- package/python/vendor/baostock/demo/demo_loanRate_data.py +26 -0
- package/python/vendor/baostock/demo/demo_moneySupplyDataMonth_data.py +26 -0
- package/python/vendor/baostock/demo/demo_moneySupplyDataYear_data.py +26 -0
- package/python/vendor/baostock/demo/demo_requiredReserveRatio_data.py +26 -0
- package/python/vendor/baostock/demo/demo_set_API_key.py +37 -0
- package/python/vendor/baostock/demo/demo_stockBasic_data.py +27 -0
- package/python/vendor/baostock/demo/demo_stock_Valuation_indicator_data.py +34 -0
- package/python/vendor/baostock/demo/demo_stock_industry.py +26 -0
- package/python/vendor/baostock/demo/demo_sz50stocks.py +26 -0
- package/python/vendor/baostock/demo/demo_zz500_stock.py +26 -0
- package/python/vendor/baostock/evaluation/__init__.py +0 -0
- package/python/vendor/baostock/evaluation/season_index.py +758 -0
- package/python/vendor/baostock/login/__init__.py +0 -0
- package/python/vendor/baostock/login/loginout.py +230 -0
- package/python/vendor/baostock/macroscopic/__init__.py +0 -0
- package/python/vendor/baostock/macroscopic/economic_data.py +723 -0
- package/python/vendor/baostock/metadata/__init__.py +0 -0
- package/python/vendor/baostock/metadata/stock_metadata.py +207 -0
- package/python/vendor/baostock/security/__init__.py +0 -0
- package/python/vendor/baostock/security/history.py +265 -0
- package/python/vendor/baostock/security/sectorinfo.py +1024 -0
- package/python/vendor/baostock/util/__init__.py +0 -0
- package/python/vendor/baostock/util/socketutil.py +97 -0
- package/python/vendor/baostock/util/stringutil.py +83 -0
- package/python/vendor/et_xmlfile/LICENSE +23 -0
- package/python/vendor/et_xmlfile/LICENSE.python +298 -0
- package/python/vendor/et_xmlfile/__init__.py +8 -0
- package/python/vendor/et_xmlfile/incremental_tree.py +917 -0
- package/python/vendor/et_xmlfile/xmlfile.py +158 -0
- package/python/vendor/openpyxl/LICENSE +23 -0
- package/python/vendor/openpyxl/__init__.py +19 -0
- package/python/vendor/openpyxl/_constants.py +13 -0
- package/python/vendor/openpyxl/cell/__init__.py +4 -0
- package/python/vendor/openpyxl/cell/_writer.py +136 -0
- package/python/vendor/openpyxl/cell/cell.py +332 -0
- package/python/vendor/openpyxl/cell/read_only.py +136 -0
- package/python/vendor/openpyxl/cell/rich_text.py +202 -0
- package/python/vendor/openpyxl/cell/text.py +184 -0
- package/python/vendor/openpyxl/chart/_3d.py +105 -0
- package/python/vendor/openpyxl/chart/__init__.py +19 -0
- package/python/vendor/openpyxl/chart/_chart.py +199 -0
- package/python/vendor/openpyxl/chart/area_chart.py +106 -0
- package/python/vendor/openpyxl/chart/axis.py +401 -0
- package/python/vendor/openpyxl/chart/bar_chart.py +144 -0
- package/python/vendor/openpyxl/chart/bubble_chart.py +67 -0
- package/python/vendor/openpyxl/chart/chartspace.py +195 -0
- package/python/vendor/openpyxl/chart/data_source.py +246 -0
- package/python/vendor/openpyxl/chart/descriptors.py +43 -0
- package/python/vendor/openpyxl/chart/error_bar.py +62 -0
- package/python/vendor/openpyxl/chart/label.py +127 -0
- package/python/vendor/openpyxl/chart/layout.py +74 -0
- package/python/vendor/openpyxl/chart/legend.py +75 -0
- package/python/vendor/openpyxl/chart/line_chart.py +129 -0
- package/python/vendor/openpyxl/chart/marker.py +90 -0
- package/python/vendor/openpyxl/chart/picture.py +35 -0
- package/python/vendor/openpyxl/chart/pie_chart.py +177 -0
- package/python/vendor/openpyxl/chart/pivot.py +65 -0
- package/python/vendor/openpyxl/chart/plotarea.py +162 -0
- package/python/vendor/openpyxl/chart/print_settings.py +57 -0
- package/python/vendor/openpyxl/chart/radar_chart.py +55 -0
- package/python/vendor/openpyxl/chart/reader.py +32 -0
- package/python/vendor/openpyxl/chart/reference.py +124 -0
- package/python/vendor/openpyxl/chart/scatter_chart.py +53 -0
- package/python/vendor/openpyxl/chart/series.py +197 -0
- package/python/vendor/openpyxl/chart/series_factory.py +41 -0
- package/python/vendor/openpyxl/chart/shapes.py +89 -0
- package/python/vendor/openpyxl/chart/stock_chart.py +54 -0
- package/python/vendor/openpyxl/chart/surface_chart.py +119 -0
- package/python/vendor/openpyxl/chart/text.py +78 -0
- package/python/vendor/openpyxl/chart/title.py +76 -0
- package/python/vendor/openpyxl/chart/trendline.py +98 -0
- package/python/vendor/openpyxl/chart/updown_bars.py +31 -0
- package/python/vendor/openpyxl/chartsheet/__init__.py +3 -0
- package/python/vendor/openpyxl/chartsheet/chartsheet.py +107 -0
- package/python/vendor/openpyxl/chartsheet/custom.py +61 -0
- package/python/vendor/openpyxl/chartsheet/properties.py +28 -0
- package/python/vendor/openpyxl/chartsheet/protection.py +41 -0
- package/python/vendor/openpyxl/chartsheet/publish.py +58 -0
- package/python/vendor/openpyxl/chartsheet/relation.py +97 -0
- package/python/vendor/openpyxl/chartsheet/views.py +51 -0
- package/python/vendor/openpyxl/comments/__init__.py +4 -0
- package/python/vendor/openpyxl/comments/author.py +21 -0
- package/python/vendor/openpyxl/comments/comment_sheet.py +211 -0
- package/python/vendor/openpyxl/comments/comments.py +62 -0
- package/python/vendor/openpyxl/comments/shape_writer.py +112 -0
- package/python/vendor/openpyxl/compat/__init__.py +54 -0
- package/python/vendor/openpyxl/compat/abc.py +8 -0
- package/python/vendor/openpyxl/compat/numbers.py +43 -0
- package/python/vendor/openpyxl/compat/product.py +17 -0
- package/python/vendor/openpyxl/compat/singleton.py +40 -0
- package/python/vendor/openpyxl/compat/strings.py +25 -0
- package/python/vendor/openpyxl/descriptors/__init__.py +58 -0
- package/python/vendor/openpyxl/descriptors/base.py +272 -0
- package/python/vendor/openpyxl/descriptors/container.py +41 -0
- package/python/vendor/openpyxl/descriptors/excel.py +112 -0
- package/python/vendor/openpyxl/descriptors/namespace.py +12 -0
- package/python/vendor/openpyxl/descriptors/nested.py +129 -0
- package/python/vendor/openpyxl/descriptors/sequence.py +136 -0
- package/python/vendor/openpyxl/descriptors/serialisable.py +240 -0
- package/python/vendor/openpyxl/descriptors/slots.py +18 -0
- package/python/vendor/openpyxl/drawing/__init__.py +4 -0
- package/python/vendor/openpyxl/drawing/colors.py +435 -0
- package/python/vendor/openpyxl/drawing/connector.py +144 -0
- package/python/vendor/openpyxl/drawing/drawing.py +92 -0
- package/python/vendor/openpyxl/drawing/effect.py +407 -0
- package/python/vendor/openpyxl/drawing/fill.py +425 -0
- package/python/vendor/openpyxl/drawing/geometry.py +584 -0
- package/python/vendor/openpyxl/drawing/graphic.py +177 -0
- package/python/vendor/openpyxl/drawing/image.py +65 -0
- package/python/vendor/openpyxl/drawing/line.py +144 -0
- package/python/vendor/openpyxl/drawing/picture.py +144 -0
- package/python/vendor/openpyxl/drawing/properties.py +174 -0
- package/python/vendor/openpyxl/drawing/relation.py +17 -0
- package/python/vendor/openpyxl/drawing/spreadsheet_drawing.py +382 -0
- package/python/vendor/openpyxl/drawing/text.py +717 -0
- package/python/vendor/openpyxl/drawing/xdr.py +33 -0
- package/python/vendor/openpyxl/formatting/__init__.py +3 -0
- package/python/vendor/openpyxl/formatting/formatting.py +114 -0
- package/python/vendor/openpyxl/formatting/rule.py +291 -0
- package/python/vendor/openpyxl/formula/__init__.py +3 -0
- package/python/vendor/openpyxl/formula/tokenizer.py +446 -0
- package/python/vendor/openpyxl/formula/translate.py +166 -0
- package/python/vendor/openpyxl/packaging/__init__.py +3 -0
- package/python/vendor/openpyxl/packaging/core.py +115 -0
- package/python/vendor/openpyxl/packaging/custom.py +289 -0
- package/python/vendor/openpyxl/packaging/extended.py +137 -0
- package/python/vendor/openpyxl/packaging/interface.py +56 -0
- package/python/vendor/openpyxl/packaging/manifest.py +194 -0
- package/python/vendor/openpyxl/packaging/relationship.py +158 -0
- package/python/vendor/openpyxl/packaging/workbook.py +185 -0
- package/python/vendor/openpyxl/pivot/__init__.py +1 -0
- package/python/vendor/openpyxl/pivot/cache.py +965 -0
- package/python/vendor/openpyxl/pivot/fields.py +326 -0
- package/python/vendor/openpyxl/pivot/record.py +111 -0
- package/python/vendor/openpyxl/pivot/table.py +1261 -0
- package/python/vendor/openpyxl/reader/__init__.py +1 -0
- package/python/vendor/openpyxl/reader/drawings.py +71 -0
- package/python/vendor/openpyxl/reader/excel.py +349 -0
- package/python/vendor/openpyxl/reader/strings.py +44 -0
- package/python/vendor/openpyxl/reader/workbook.py +133 -0
- package/python/vendor/openpyxl/styles/__init__.py +11 -0
- package/python/vendor/openpyxl/styles/alignment.py +62 -0
- package/python/vendor/openpyxl/styles/borders.py +103 -0
- package/python/vendor/openpyxl/styles/builtins.py +1397 -0
- package/python/vendor/openpyxl/styles/cell_style.py +206 -0
- package/python/vendor/openpyxl/styles/colors.py +172 -0
- package/python/vendor/openpyxl/styles/differential.py +95 -0
- package/python/vendor/openpyxl/styles/fills.py +224 -0
- package/python/vendor/openpyxl/styles/fonts.py +113 -0
- package/python/vendor/openpyxl/styles/named_styles.py +282 -0
- package/python/vendor/openpyxl/styles/numbers.py +200 -0
- package/python/vendor/openpyxl/styles/protection.py +17 -0
- package/python/vendor/openpyxl/styles/proxy.py +62 -0
- package/python/vendor/openpyxl/styles/styleable.py +151 -0
- package/python/vendor/openpyxl/styles/stylesheet.py +274 -0
- package/python/vendor/openpyxl/styles/table.py +94 -0
- package/python/vendor/openpyxl/utils/__init__.py +17 -0
- package/python/vendor/openpyxl/utils/bound_dictionary.py +26 -0
- package/python/vendor/openpyxl/utils/cell.py +240 -0
- package/python/vendor/openpyxl/utils/dataframe.py +87 -0
- package/python/vendor/openpyxl/utils/datetime.py +140 -0
- package/python/vendor/openpyxl/utils/escape.py +43 -0
- package/python/vendor/openpyxl/utils/exceptions.py +34 -0
- package/python/vendor/openpyxl/utils/formulas.py +24 -0
- package/python/vendor/openpyxl/utils/indexed_list.py +49 -0
- package/python/vendor/openpyxl/utils/inference.py +60 -0
- package/python/vendor/openpyxl/utils/protection.py +22 -0
- package/python/vendor/openpyxl/utils/units.py +108 -0
- package/python/vendor/openpyxl/workbook/__init__.py +4 -0
- package/python/vendor/openpyxl/workbook/_writer.py +197 -0
- package/python/vendor/openpyxl/workbook/child.py +166 -0
- package/python/vendor/openpyxl/workbook/defined_name.py +189 -0
- package/python/vendor/openpyxl/workbook/external_link/__init__.py +3 -0
- package/python/vendor/openpyxl/workbook/external_link/external.py +190 -0
- package/python/vendor/openpyxl/workbook/external_reference.py +18 -0
- package/python/vendor/openpyxl/workbook/function_group.py +36 -0
- package/python/vendor/openpyxl/workbook/properties.py +151 -0
- package/python/vendor/openpyxl/workbook/protection.py +163 -0
- package/python/vendor/openpyxl/workbook/smart_tags.py +56 -0
- package/python/vendor/openpyxl/workbook/views.py +155 -0
- package/python/vendor/openpyxl/workbook/web.py +98 -0
- package/python/vendor/openpyxl/workbook/workbook.py +438 -0
- package/python/vendor/openpyxl/worksheet/__init__.py +1 -0
- package/python/vendor/openpyxl/worksheet/_read_only.py +190 -0
- package/python/vendor/openpyxl/worksheet/_reader.py +472 -0
- package/python/vendor/openpyxl/worksheet/_write_only.py +160 -0
- package/python/vendor/openpyxl/worksheet/_writer.py +390 -0
- package/python/vendor/openpyxl/worksheet/cell_range.py +512 -0
- package/python/vendor/openpyxl/worksheet/cell_watch.py +34 -0
- package/python/vendor/openpyxl/worksheet/controls.py +107 -0
- package/python/vendor/openpyxl/worksheet/copier.py +70 -0
- package/python/vendor/openpyxl/worksheet/custom.py +35 -0
- package/python/vendor/openpyxl/worksheet/datavalidation.py +202 -0
- package/python/vendor/openpyxl/worksheet/dimensions.py +306 -0
- package/python/vendor/openpyxl/worksheet/drawing.py +14 -0
- package/python/vendor/openpyxl/worksheet/errors.py +93 -0
- package/python/vendor/openpyxl/worksheet/filters.py +486 -0
- package/python/vendor/openpyxl/worksheet/formula.py +51 -0
- package/python/vendor/openpyxl/worksheet/header_footer.py +270 -0
- package/python/vendor/openpyxl/worksheet/hyperlink.py +46 -0
- package/python/vendor/openpyxl/worksheet/merge.py +141 -0
- package/python/vendor/openpyxl/worksheet/ole.py +133 -0
- package/python/vendor/openpyxl/worksheet/page.py +174 -0
- package/python/vendor/openpyxl/worksheet/pagebreak.py +94 -0
- package/python/vendor/openpyxl/worksheet/picture.py +8 -0
- package/python/vendor/openpyxl/worksheet/print_settings.py +184 -0
- package/python/vendor/openpyxl/worksheet/properties.py +97 -0
- package/python/vendor/openpyxl/worksheet/protection.py +120 -0
- package/python/vendor/openpyxl/worksheet/related.py +17 -0
- package/python/vendor/openpyxl/worksheet/scenario.py +105 -0
- package/python/vendor/openpyxl/worksheet/smart_tag.py +78 -0
- package/python/vendor/openpyxl/worksheet/table.py +385 -0
- package/python/vendor/openpyxl/worksheet/views.py +155 -0
- package/python/vendor/openpyxl/worksheet/worksheet.py +907 -0
- package/python/vendor/openpyxl/writer/__init__.py +1 -0
- package/python/vendor/openpyxl/writer/excel.py +295 -0
- package/python/vendor/openpyxl/writer/theme.py +291 -0
- package/python/vendor/openpyxl/xml/__init__.py +42 -0
- package/python/vendor/openpyxl/xml/constants.py +129 -0
- package/python/vendor/openpyxl/xml/functions.py +87 -0
- package/watchlist/package.json +1 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
#Autogenerated schema
|
|
2
|
+
from openpyxl.descriptors.serialisable import Serialisable
|
|
3
|
+
from openpyxl.descriptors import (
|
|
4
|
+
Typed,
|
|
5
|
+
Bool,
|
|
6
|
+
MinMax,
|
|
7
|
+
Integer,
|
|
8
|
+
NoneSet,
|
|
9
|
+
Float,
|
|
10
|
+
Alias,
|
|
11
|
+
Sequence,
|
|
12
|
+
)
|
|
13
|
+
from openpyxl.descriptors.excel import ExtensionList, Percentage
|
|
14
|
+
from openpyxl.descriptors.nested import (
|
|
15
|
+
NestedBool,
|
|
16
|
+
NestedMinMax,
|
|
17
|
+
NestedInteger,
|
|
18
|
+
NestedFloat,
|
|
19
|
+
NestedNoneSet,
|
|
20
|
+
NestedSet,
|
|
21
|
+
)
|
|
22
|
+
from openpyxl.descriptors.sequence import ValueSequence
|
|
23
|
+
|
|
24
|
+
from ._chart import ChartBase
|
|
25
|
+
from .axis import ChartLines
|
|
26
|
+
from .descriptors import NestedGapAmount
|
|
27
|
+
from .series import Series
|
|
28
|
+
from .label import DataLabelList
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class _PieChartBase(ChartBase):
|
|
32
|
+
|
|
33
|
+
varyColors = NestedBool(allow_none=True)
|
|
34
|
+
ser = Sequence(expected_type=Series, allow_none=True)
|
|
35
|
+
dLbls = Typed(expected_type=DataLabelList, allow_none=True)
|
|
36
|
+
dataLabels = Alias("dLbls")
|
|
37
|
+
|
|
38
|
+
_series_type = "pie"
|
|
39
|
+
|
|
40
|
+
__elements__ = ('varyColors', 'ser', 'dLbls')
|
|
41
|
+
|
|
42
|
+
def __init__(self,
|
|
43
|
+
varyColors=True,
|
|
44
|
+
ser=(),
|
|
45
|
+
dLbls=None,
|
|
46
|
+
):
|
|
47
|
+
self.varyColors = varyColors
|
|
48
|
+
self.ser = ser
|
|
49
|
+
self.dLbls = dLbls
|
|
50
|
+
super().__init__()
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class PieChart(_PieChartBase):
|
|
55
|
+
|
|
56
|
+
tagname = "pieChart"
|
|
57
|
+
|
|
58
|
+
varyColors = _PieChartBase.varyColors
|
|
59
|
+
ser = _PieChartBase.ser
|
|
60
|
+
dLbls = _PieChartBase.dLbls
|
|
61
|
+
|
|
62
|
+
firstSliceAng = NestedMinMax(min=0, max=360)
|
|
63
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
64
|
+
|
|
65
|
+
__elements__ = _PieChartBase.__elements__ + ('firstSliceAng', )
|
|
66
|
+
|
|
67
|
+
def __init__(self,
|
|
68
|
+
firstSliceAng=0,
|
|
69
|
+
extLst=None,
|
|
70
|
+
**kw
|
|
71
|
+
):
|
|
72
|
+
self.firstSliceAng = firstSliceAng
|
|
73
|
+
super().__init__(**kw)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class PieChart3D(_PieChartBase):
|
|
77
|
+
|
|
78
|
+
tagname = "pie3DChart"
|
|
79
|
+
|
|
80
|
+
varyColors = _PieChartBase.varyColors
|
|
81
|
+
ser = _PieChartBase.ser
|
|
82
|
+
dLbls = _PieChartBase.dLbls
|
|
83
|
+
|
|
84
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
85
|
+
|
|
86
|
+
__elements__ = _PieChartBase.__elements__
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class DoughnutChart(_PieChartBase):
|
|
90
|
+
|
|
91
|
+
tagname = "doughnutChart"
|
|
92
|
+
|
|
93
|
+
varyColors = _PieChartBase.varyColors
|
|
94
|
+
ser = _PieChartBase.ser
|
|
95
|
+
dLbls = _PieChartBase.dLbls
|
|
96
|
+
|
|
97
|
+
firstSliceAng = NestedMinMax(min=0, max=360)
|
|
98
|
+
holeSize = NestedMinMax(min=1, max=90, allow_none=True)
|
|
99
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
100
|
+
|
|
101
|
+
__elements__ = _PieChartBase.__elements__ + ('firstSliceAng', 'holeSize')
|
|
102
|
+
|
|
103
|
+
def __init__(self,
|
|
104
|
+
firstSliceAng=0,
|
|
105
|
+
holeSize=10,
|
|
106
|
+
extLst=None,
|
|
107
|
+
**kw
|
|
108
|
+
):
|
|
109
|
+
self.firstSliceAng = firstSliceAng
|
|
110
|
+
self.holeSize = holeSize
|
|
111
|
+
super().__init__(**kw)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class CustomSplit(Serialisable):
|
|
115
|
+
|
|
116
|
+
tagname = "custSplit"
|
|
117
|
+
|
|
118
|
+
secondPiePt = ValueSequence(expected_type=int)
|
|
119
|
+
|
|
120
|
+
__elements__ = ('secondPiePt',)
|
|
121
|
+
|
|
122
|
+
def __init__(self,
|
|
123
|
+
secondPiePt=(),
|
|
124
|
+
):
|
|
125
|
+
self.secondPiePt = secondPiePt
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class ProjectedPieChart(_PieChartBase):
|
|
129
|
+
|
|
130
|
+
"""
|
|
131
|
+
From the spec 21.2.2.126
|
|
132
|
+
|
|
133
|
+
This element contains the pie of pie or bar of pie series on this
|
|
134
|
+
chart. Only the first series shall be displayed. The splitType element
|
|
135
|
+
shall determine whether the splitPos and custSplit elements apply.
|
|
136
|
+
"""
|
|
137
|
+
|
|
138
|
+
tagname = "ofPieChart"
|
|
139
|
+
|
|
140
|
+
varyColors = _PieChartBase.varyColors
|
|
141
|
+
ser = _PieChartBase.ser
|
|
142
|
+
dLbls = _PieChartBase.dLbls
|
|
143
|
+
|
|
144
|
+
ofPieType = NestedSet(values=(['pie', 'bar']))
|
|
145
|
+
type = Alias('ofPieType')
|
|
146
|
+
gapWidth = NestedGapAmount()
|
|
147
|
+
splitType = NestedNoneSet(values=(['auto', 'cust', 'percent', 'pos', 'val']))
|
|
148
|
+
splitPos = NestedFloat(allow_none=True)
|
|
149
|
+
custSplit = Typed(expected_type=CustomSplit, allow_none=True)
|
|
150
|
+
secondPieSize = NestedMinMax(min=5, max=200, allow_none=True)
|
|
151
|
+
serLines = Typed(expected_type=ChartLines, allow_none=True)
|
|
152
|
+
join_lines = Alias('serLines')
|
|
153
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
154
|
+
|
|
155
|
+
__elements__ = _PieChartBase.__elements__ + ('ofPieType', 'gapWidth',
|
|
156
|
+
'splitType', 'splitPos', 'custSplit', 'secondPieSize', 'serLines')
|
|
157
|
+
|
|
158
|
+
def __init__(self,
|
|
159
|
+
ofPieType="pie",
|
|
160
|
+
gapWidth=None,
|
|
161
|
+
splitType="auto",
|
|
162
|
+
splitPos=None,
|
|
163
|
+
custSplit=None,
|
|
164
|
+
secondPieSize=75,
|
|
165
|
+
serLines=None,
|
|
166
|
+
extLst=None,
|
|
167
|
+
**kw
|
|
168
|
+
):
|
|
169
|
+
self.ofPieType = ofPieType
|
|
170
|
+
self.gapWidth = gapWidth
|
|
171
|
+
self.splitType = splitType
|
|
172
|
+
self.splitPos = splitPos
|
|
173
|
+
self.custSplit = custSplit
|
|
174
|
+
self.secondPieSize = secondPieSize
|
|
175
|
+
if serLines is None:
|
|
176
|
+
self.serLines = ChartLines()
|
|
177
|
+
super().__init__(**kw)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) 2010-2024 openpyxl
|
|
3
|
+
|
|
4
|
+
from openpyxl.descriptors.serialisable import Serialisable
|
|
5
|
+
from openpyxl.descriptors import (
|
|
6
|
+
Alias,
|
|
7
|
+
Typed,
|
|
8
|
+
)
|
|
9
|
+
from openpyxl.descriptors.nested import NestedInteger, NestedText
|
|
10
|
+
from openpyxl.descriptors.excel import ExtensionList
|
|
11
|
+
|
|
12
|
+
from .label import DataLabel
|
|
13
|
+
from .marker import Marker
|
|
14
|
+
from .shapes import GraphicalProperties
|
|
15
|
+
from .text import RichText
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PivotSource(Serialisable):
|
|
19
|
+
|
|
20
|
+
tagname = "pivotSource"
|
|
21
|
+
|
|
22
|
+
name = NestedText(expected_type=str)
|
|
23
|
+
fmtId = NestedInteger(expected_type=int)
|
|
24
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
25
|
+
|
|
26
|
+
__elements__ = ('name', 'fmtId')
|
|
27
|
+
|
|
28
|
+
def __init__(self,
|
|
29
|
+
name=None,
|
|
30
|
+
fmtId=None,
|
|
31
|
+
extLst=None,
|
|
32
|
+
):
|
|
33
|
+
self.name = name
|
|
34
|
+
self.fmtId = fmtId
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class PivotFormat(Serialisable):
|
|
38
|
+
|
|
39
|
+
tagname = "pivotFmt"
|
|
40
|
+
|
|
41
|
+
idx = NestedInteger(nested=True)
|
|
42
|
+
spPr = Typed(expected_type=GraphicalProperties, allow_none=True)
|
|
43
|
+
graphicalProperties = Alias("spPr")
|
|
44
|
+
txPr = Typed(expected_type=RichText, allow_none=True)
|
|
45
|
+
TextBody = Alias("txPr")
|
|
46
|
+
marker = Typed(expected_type=Marker, allow_none=True)
|
|
47
|
+
dLbl = Typed(expected_type=DataLabel, allow_none=True)
|
|
48
|
+
DataLabel = Alias("dLbl")
|
|
49
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
50
|
+
|
|
51
|
+
__elements__ = ('idx', 'spPr', 'txPr', 'marker', 'dLbl')
|
|
52
|
+
|
|
53
|
+
def __init__(self,
|
|
54
|
+
idx=0,
|
|
55
|
+
spPr=None,
|
|
56
|
+
txPr=None,
|
|
57
|
+
marker=None,
|
|
58
|
+
dLbl=None,
|
|
59
|
+
extLst=None,
|
|
60
|
+
):
|
|
61
|
+
self.idx = idx
|
|
62
|
+
self.spPr = spPr
|
|
63
|
+
self.txPr = txPr
|
|
64
|
+
self.marker = marker
|
|
65
|
+
self.dLbl = dLbl
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Copyright (c) 2010-2024 openpyxl
|
|
2
|
+
|
|
3
|
+
from openpyxl.descriptors.serialisable import Serialisable
|
|
4
|
+
from openpyxl.descriptors import (
|
|
5
|
+
Typed,
|
|
6
|
+
Alias,
|
|
7
|
+
)
|
|
8
|
+
from openpyxl.descriptors.excel import (
|
|
9
|
+
ExtensionList,
|
|
10
|
+
)
|
|
11
|
+
from openpyxl.descriptors.sequence import (
|
|
12
|
+
MultiSequence,
|
|
13
|
+
MultiSequencePart,
|
|
14
|
+
)
|
|
15
|
+
from openpyxl.descriptors.nested import (
|
|
16
|
+
NestedBool,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
from ._3d import _3DBase
|
|
20
|
+
from .area_chart import AreaChart, AreaChart3D
|
|
21
|
+
from .bar_chart import BarChart, BarChart3D
|
|
22
|
+
from .bubble_chart import BubbleChart
|
|
23
|
+
from .line_chart import LineChart, LineChart3D
|
|
24
|
+
from .pie_chart import PieChart, PieChart3D, ProjectedPieChart, DoughnutChart
|
|
25
|
+
from .radar_chart import RadarChart
|
|
26
|
+
from .scatter_chart import ScatterChart
|
|
27
|
+
from .stock_chart import StockChart
|
|
28
|
+
from .surface_chart import SurfaceChart, SurfaceChart3D
|
|
29
|
+
from .layout import Layout
|
|
30
|
+
from .shapes import GraphicalProperties
|
|
31
|
+
from .text import RichText
|
|
32
|
+
|
|
33
|
+
from .axis import (
|
|
34
|
+
NumericAxis,
|
|
35
|
+
TextAxis,
|
|
36
|
+
SeriesAxis,
|
|
37
|
+
DateAxis,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class DataTable(Serialisable):
|
|
42
|
+
|
|
43
|
+
tagname = "dTable"
|
|
44
|
+
|
|
45
|
+
showHorzBorder = NestedBool(allow_none=True)
|
|
46
|
+
showVertBorder = NestedBool(allow_none=True)
|
|
47
|
+
showOutline = NestedBool(allow_none=True)
|
|
48
|
+
showKeys = NestedBool(allow_none=True)
|
|
49
|
+
spPr = Typed(expected_type=GraphicalProperties, allow_none=True)
|
|
50
|
+
graphicalProperties = Alias('spPr')
|
|
51
|
+
txPr = Typed(expected_type=RichText, allow_none=True)
|
|
52
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
53
|
+
|
|
54
|
+
__elements__ = ('showHorzBorder', 'showVertBorder', 'showOutline',
|
|
55
|
+
'showKeys', 'spPr', 'txPr')
|
|
56
|
+
|
|
57
|
+
def __init__(self,
|
|
58
|
+
showHorzBorder=None,
|
|
59
|
+
showVertBorder=None,
|
|
60
|
+
showOutline=None,
|
|
61
|
+
showKeys=None,
|
|
62
|
+
spPr=None,
|
|
63
|
+
txPr=None,
|
|
64
|
+
extLst=None,
|
|
65
|
+
):
|
|
66
|
+
self.showHorzBorder = showHorzBorder
|
|
67
|
+
self.showVertBorder = showVertBorder
|
|
68
|
+
self.showOutline = showOutline
|
|
69
|
+
self.showKeys = showKeys
|
|
70
|
+
self.spPr = spPr
|
|
71
|
+
self.txPr = txPr
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class PlotArea(Serialisable):
|
|
75
|
+
|
|
76
|
+
tagname = "plotArea"
|
|
77
|
+
|
|
78
|
+
layout = Typed(expected_type=Layout, allow_none=True)
|
|
79
|
+
dTable = Typed(expected_type=DataTable, allow_none=True)
|
|
80
|
+
spPr = Typed(expected_type=GraphicalProperties, allow_none=True)
|
|
81
|
+
graphicalProperties = Alias("spPr")
|
|
82
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
83
|
+
|
|
84
|
+
# at least one chart
|
|
85
|
+
_charts = MultiSequence()
|
|
86
|
+
areaChart = MultiSequencePart(expected_type=AreaChart, store="_charts")
|
|
87
|
+
area3DChart = MultiSequencePart(expected_type=AreaChart3D, store="_charts")
|
|
88
|
+
lineChart = MultiSequencePart(expected_type=LineChart, store="_charts")
|
|
89
|
+
line3DChart = MultiSequencePart(expected_type=LineChart3D, store="_charts")
|
|
90
|
+
stockChart = MultiSequencePart(expected_type=StockChart, store="_charts")
|
|
91
|
+
radarChart = MultiSequencePart(expected_type=RadarChart, store="_charts")
|
|
92
|
+
scatterChart = MultiSequencePart(expected_type=ScatterChart, store="_charts")
|
|
93
|
+
pieChart = MultiSequencePart(expected_type=PieChart, store="_charts")
|
|
94
|
+
pie3DChart = MultiSequencePart(expected_type=PieChart3D, store="_charts")
|
|
95
|
+
doughnutChart = MultiSequencePart(expected_type=DoughnutChart, store="_charts")
|
|
96
|
+
barChart = MultiSequencePart(expected_type=BarChart, store="_charts")
|
|
97
|
+
bar3DChart = MultiSequencePart(expected_type=BarChart3D, store="_charts")
|
|
98
|
+
ofPieChart = MultiSequencePart(expected_type=ProjectedPieChart, store="_charts")
|
|
99
|
+
surfaceChart = MultiSequencePart(expected_type=SurfaceChart, store="_charts")
|
|
100
|
+
surface3DChart = MultiSequencePart(expected_type=SurfaceChart3D, store="_charts")
|
|
101
|
+
bubbleChart = MultiSequencePart(expected_type=BubbleChart, store="_charts")
|
|
102
|
+
|
|
103
|
+
# axes
|
|
104
|
+
_axes = MultiSequence()
|
|
105
|
+
valAx = MultiSequencePart(expected_type=NumericAxis, store="_axes")
|
|
106
|
+
catAx = MultiSequencePart(expected_type=TextAxis, store="_axes")
|
|
107
|
+
dateAx = MultiSequencePart(expected_type=DateAxis, store="_axes")
|
|
108
|
+
serAx = MultiSequencePart(expected_type=SeriesAxis, store="_axes")
|
|
109
|
+
|
|
110
|
+
__elements__ = ('layout', '_charts', '_axes', 'dTable', 'spPr')
|
|
111
|
+
|
|
112
|
+
def __init__(self,
|
|
113
|
+
layout=None,
|
|
114
|
+
dTable=None,
|
|
115
|
+
spPr=None,
|
|
116
|
+
_charts=(),
|
|
117
|
+
_axes=(),
|
|
118
|
+
extLst=None,
|
|
119
|
+
):
|
|
120
|
+
self.layout = layout
|
|
121
|
+
self.dTable = dTable
|
|
122
|
+
self.spPr = spPr
|
|
123
|
+
self._charts = _charts
|
|
124
|
+
self._axes = _axes
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def to_tree(self, tagname=None, idx=None, namespace=None):
|
|
128
|
+
axIds = {ax.axId for ax in self._axes}
|
|
129
|
+
for chart in self._charts:
|
|
130
|
+
for id, axis in chart._axes.items():
|
|
131
|
+
if id not in axIds:
|
|
132
|
+
setattr(self, axis.tagname, axis)
|
|
133
|
+
axIds.add(id)
|
|
134
|
+
|
|
135
|
+
return super().to_tree(tagname)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@classmethod
|
|
139
|
+
def from_tree(cls, node):
|
|
140
|
+
self = super().from_tree(node)
|
|
141
|
+
axes = dict((axis.axId, axis) for axis in self._axes)
|
|
142
|
+
for chart in self._charts:
|
|
143
|
+
if isinstance(chart, (ScatterChart, BubbleChart)):
|
|
144
|
+
x, y = (axes[axId] for axId in chart.axId)
|
|
145
|
+
chart.x_axis = x
|
|
146
|
+
chart.y_axis = y
|
|
147
|
+
continue
|
|
148
|
+
|
|
149
|
+
for axId in chart.axId:
|
|
150
|
+
axis = axes.get(axId)
|
|
151
|
+
if axis is None and isinstance(chart, _3DBase):
|
|
152
|
+
# Series Axis can be optional
|
|
153
|
+
chart.z_axis = None
|
|
154
|
+
continue
|
|
155
|
+
if axis.tagname in ("catAx", "dateAx"):
|
|
156
|
+
chart.x_axis = axis
|
|
157
|
+
elif axis.tagname == "valAx":
|
|
158
|
+
chart.y_axis = axis
|
|
159
|
+
elif axis.tagname == "serAx":
|
|
160
|
+
chart.z_axis = axis
|
|
161
|
+
|
|
162
|
+
return self
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Copyright (c) 2010-2024 openpyxl
|
|
2
|
+
|
|
3
|
+
from openpyxl.descriptors.serialisable import Serialisable
|
|
4
|
+
from openpyxl.descriptors import (
|
|
5
|
+
Float,
|
|
6
|
+
Typed,
|
|
7
|
+
Alias,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
from openpyxl.worksheet.page import PrintPageSetup
|
|
11
|
+
from openpyxl.worksheet.header_footer import HeaderFooter
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class PageMargins(Serialisable):
|
|
15
|
+
"""
|
|
16
|
+
Identical to openpyxl.worksheet.page.Pagemargins but element names are different :-/
|
|
17
|
+
"""
|
|
18
|
+
tagname = "pageMargins"
|
|
19
|
+
|
|
20
|
+
l = Float()
|
|
21
|
+
left = Alias('l')
|
|
22
|
+
r = Float()
|
|
23
|
+
right = Alias('r')
|
|
24
|
+
t = Float()
|
|
25
|
+
top = Alias('t')
|
|
26
|
+
b = Float()
|
|
27
|
+
bottom = Alias('b')
|
|
28
|
+
header = Float()
|
|
29
|
+
footer = Float()
|
|
30
|
+
|
|
31
|
+
def __init__(self, l=0.75, r=0.75, t=1, b=1, header=0.5, footer=0.5):
|
|
32
|
+
self.l = l
|
|
33
|
+
self.r = r
|
|
34
|
+
self.t = t
|
|
35
|
+
self.b = b
|
|
36
|
+
self.header = header
|
|
37
|
+
self.footer = footer
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class PrintSettings(Serialisable):
|
|
41
|
+
|
|
42
|
+
tagname = "printSettings"
|
|
43
|
+
|
|
44
|
+
headerFooter = Typed(expected_type=HeaderFooter, allow_none=True)
|
|
45
|
+
pageMargins = Typed(expected_type=PageMargins, allow_none=True)
|
|
46
|
+
pageSetup = Typed(expected_type=PrintPageSetup, allow_none=True)
|
|
47
|
+
|
|
48
|
+
__elements__ = ("headerFooter", "pageMargins", "pageMargins")
|
|
49
|
+
|
|
50
|
+
def __init__(self,
|
|
51
|
+
headerFooter=None,
|
|
52
|
+
pageMargins=None,
|
|
53
|
+
pageSetup=None,
|
|
54
|
+
):
|
|
55
|
+
self.headerFooter = headerFooter
|
|
56
|
+
self.pageMargins = pageMargins
|
|
57
|
+
self.pageSetup = pageSetup
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Copyright (c) 2010-2024 openpyxl
|
|
2
|
+
|
|
3
|
+
from openpyxl.descriptors.serialisable import Serialisable
|
|
4
|
+
from openpyxl.descriptors import (
|
|
5
|
+
Sequence,
|
|
6
|
+
Typed,
|
|
7
|
+
Alias,
|
|
8
|
+
)
|
|
9
|
+
from openpyxl.descriptors.excel import ExtensionList
|
|
10
|
+
from openpyxl.descriptors.nested import (
|
|
11
|
+
NestedBool,
|
|
12
|
+
NestedInteger,
|
|
13
|
+
NestedSet
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
from ._chart import ChartBase
|
|
17
|
+
from .axis import TextAxis, NumericAxis
|
|
18
|
+
from .series import Series
|
|
19
|
+
from .label import DataLabelList
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class RadarChart(ChartBase):
|
|
23
|
+
|
|
24
|
+
tagname = "radarChart"
|
|
25
|
+
|
|
26
|
+
radarStyle = NestedSet(values=(['standard', 'marker', 'filled']))
|
|
27
|
+
type = Alias("radarStyle")
|
|
28
|
+
varyColors = NestedBool(nested=True, allow_none=True)
|
|
29
|
+
ser = Sequence(expected_type=Series, allow_none=True)
|
|
30
|
+
dLbls = Typed(expected_type=DataLabelList, allow_none=True)
|
|
31
|
+
dataLabels = Alias("dLbls")
|
|
32
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
33
|
+
|
|
34
|
+
_series_type = "radar"
|
|
35
|
+
|
|
36
|
+
x_axis = Typed(expected_type=TextAxis)
|
|
37
|
+
y_axis = Typed(expected_type=NumericAxis)
|
|
38
|
+
|
|
39
|
+
__elements__ = ('radarStyle', 'varyColors', 'ser', 'dLbls', 'axId')
|
|
40
|
+
|
|
41
|
+
def __init__(self,
|
|
42
|
+
radarStyle="standard",
|
|
43
|
+
varyColors=None,
|
|
44
|
+
ser=(),
|
|
45
|
+
dLbls=None,
|
|
46
|
+
extLst=None,
|
|
47
|
+
**kw
|
|
48
|
+
):
|
|
49
|
+
self.radarStyle = radarStyle
|
|
50
|
+
self.varyColors = varyColors
|
|
51
|
+
self.ser = ser
|
|
52
|
+
self.dLbls = dLbls
|
|
53
|
+
self.x_axis = TextAxis()
|
|
54
|
+
self.y_axis = NumericAxis()
|
|
55
|
+
super().__init__(**kw)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Copyright (c) 2010-2024 openpyxl
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Read a chart
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
def read_chart(chartspace):
|
|
8
|
+
cs = chartspace
|
|
9
|
+
plot = cs.chart.plotArea
|
|
10
|
+
|
|
11
|
+
chart = plot._charts[0]
|
|
12
|
+
chart._charts = plot._charts
|
|
13
|
+
|
|
14
|
+
chart.title = cs.chart.title
|
|
15
|
+
chart.display_blanks = cs.chart.dispBlanksAs
|
|
16
|
+
chart.visible_cells_only = cs.chart.plotVisOnly
|
|
17
|
+
chart.layout = plot.layout
|
|
18
|
+
chart.legend = cs.chart.legend
|
|
19
|
+
|
|
20
|
+
# 3d attributes
|
|
21
|
+
chart.floor = cs.chart.floor
|
|
22
|
+
chart.sideWall = cs.chart.sideWall
|
|
23
|
+
chart.backWall = cs.chart.backWall
|
|
24
|
+
chart.pivotSource = cs.pivotSource
|
|
25
|
+
chart.pivotFormats = cs.chart.pivotFmts
|
|
26
|
+
chart.idx_base = min((s.idx for s in chart.series), default=0)
|
|
27
|
+
chart._reindex()
|
|
28
|
+
|
|
29
|
+
# Border, fill, etc.
|
|
30
|
+
chart.graphical_properties = cs.graphical_properties
|
|
31
|
+
|
|
32
|
+
return chart
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Copyright (c) 2010-2024 openpyxl
|
|
2
|
+
|
|
3
|
+
from itertools import chain
|
|
4
|
+
|
|
5
|
+
from openpyxl.descriptors.serialisable import Serialisable
|
|
6
|
+
from openpyxl.descriptors import (
|
|
7
|
+
MinMax,
|
|
8
|
+
Typed,
|
|
9
|
+
String,
|
|
10
|
+
Strict,
|
|
11
|
+
)
|
|
12
|
+
from openpyxl.worksheet.worksheet import Worksheet
|
|
13
|
+
from openpyxl.utils import (
|
|
14
|
+
get_column_letter,
|
|
15
|
+
range_to_tuple,
|
|
16
|
+
quote_sheetname
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class DummyWorksheet:
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def __init__(self, title):
|
|
24
|
+
self.title = title
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Reference(Strict):
|
|
28
|
+
|
|
29
|
+
"""
|
|
30
|
+
Normalise cell range references
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
min_row = MinMax(min=1, max=1000000, expected_type=int)
|
|
34
|
+
max_row = MinMax(min=1, max=1000000, expected_type=int)
|
|
35
|
+
min_col = MinMax(min=1, max=16384, expected_type=int)
|
|
36
|
+
max_col = MinMax(min=1, max=16384, expected_type=int)
|
|
37
|
+
range_string = String(allow_none=True)
|
|
38
|
+
|
|
39
|
+
def __init__(self,
|
|
40
|
+
worksheet=None,
|
|
41
|
+
min_col=None,
|
|
42
|
+
min_row=None,
|
|
43
|
+
max_col=None,
|
|
44
|
+
max_row=None,
|
|
45
|
+
range_string=None
|
|
46
|
+
):
|
|
47
|
+
if range_string is not None:
|
|
48
|
+
sheetname, boundaries = range_to_tuple(range_string)
|
|
49
|
+
min_col, min_row, max_col, max_row = boundaries
|
|
50
|
+
worksheet = DummyWorksheet(sheetname)
|
|
51
|
+
|
|
52
|
+
self.worksheet = worksheet
|
|
53
|
+
self.min_col = min_col
|
|
54
|
+
self.min_row = min_row
|
|
55
|
+
if max_col is None:
|
|
56
|
+
max_col = min_col
|
|
57
|
+
self.max_col = max_col
|
|
58
|
+
if max_row is None:
|
|
59
|
+
max_row = min_row
|
|
60
|
+
self.max_row = max_row
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def __repr__(self):
|
|
64
|
+
return str(self)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def __str__(self):
|
|
68
|
+
fmt = u"{0}!${1}${2}:${3}${4}"
|
|
69
|
+
if (self.min_col == self.max_col
|
|
70
|
+
and self.min_row == self.max_row):
|
|
71
|
+
fmt = u"{0}!${1}${2}"
|
|
72
|
+
return fmt.format(self.sheetname,
|
|
73
|
+
get_column_letter(self.min_col), self.min_row,
|
|
74
|
+
get_column_letter(self.max_col), self.max_row
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
__str__ = __str__
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def __len__(self):
|
|
83
|
+
if self.min_row == self.max_row:
|
|
84
|
+
return 1 + self.max_col - self.min_col
|
|
85
|
+
return 1 + self.max_row - self.min_row
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def __eq__(self, other):
|
|
89
|
+
return str(self) == str(other)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def rows(self):
|
|
94
|
+
"""
|
|
95
|
+
Return all rows in the range
|
|
96
|
+
"""
|
|
97
|
+
for row in range(self.min_row, self.max_row+1):
|
|
98
|
+
yield Reference(self.worksheet, self.min_col, row, self.max_col, row)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@property
|
|
102
|
+
def cols(self):
|
|
103
|
+
"""
|
|
104
|
+
Return all columns in the range
|
|
105
|
+
"""
|
|
106
|
+
for col in range(self.min_col, self.max_col+1):
|
|
107
|
+
yield Reference(self.worksheet, col, self.min_row, col, self.max_row)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def pop(self):
|
|
111
|
+
"""
|
|
112
|
+
Return and remove the first cell
|
|
113
|
+
"""
|
|
114
|
+
cell = "{0}{1}".format(get_column_letter(self.min_col), self.min_row)
|
|
115
|
+
if self.min_row == self.max_row:
|
|
116
|
+
self.min_col += 1
|
|
117
|
+
else:
|
|
118
|
+
self.min_row += 1
|
|
119
|
+
return cell
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
@property
|
|
123
|
+
def sheetname(self):
|
|
124
|
+
return quote_sheetname(self.worksheet.title)
|