@v587d/capital-generation 2.29.0 → 2.30.1
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 +58 -0
- package/README.md +3 -3
- 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/dataset-tools.js +4 -2
- package/lib/data-collector/describe.d.ts +2 -0
- package/lib/data-collector/describe.js +2 -0
- package/lib/data-collector/store.d.ts +11 -0
- package/lib/data-collector/store.js +80 -1
- package/lib/data-collector/tools.d.ts +1 -1
- package/lib/data-collector/tools.js +10 -9
- 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/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 +517 -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 +1 -1
- 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,199 @@
|
|
|
1
|
+
# Copyright (c) 2010-2024 openpyxl
|
|
2
|
+
|
|
3
|
+
from collections import OrderedDict
|
|
4
|
+
from operator import attrgetter
|
|
5
|
+
|
|
6
|
+
from openpyxl.descriptors import (
|
|
7
|
+
Typed,
|
|
8
|
+
Integer,
|
|
9
|
+
Alias,
|
|
10
|
+
MinMax,
|
|
11
|
+
Bool,
|
|
12
|
+
Set,
|
|
13
|
+
)
|
|
14
|
+
from openpyxl.descriptors.sequence import ValueSequence
|
|
15
|
+
from openpyxl.descriptors.serialisable import Serialisable
|
|
16
|
+
|
|
17
|
+
from ._3d import _3DBase
|
|
18
|
+
from .data_source import AxDataSource, NumRef
|
|
19
|
+
from .layout import Layout
|
|
20
|
+
from .legend import Legend
|
|
21
|
+
from .reference import Reference
|
|
22
|
+
from .series_factory import SeriesFactory
|
|
23
|
+
from .series import attribute_mapping
|
|
24
|
+
from .shapes import GraphicalProperties
|
|
25
|
+
from .title import TitleDescriptor
|
|
26
|
+
|
|
27
|
+
class AxId(Serialisable):
|
|
28
|
+
|
|
29
|
+
val = Integer()
|
|
30
|
+
|
|
31
|
+
def __init__(self, val):
|
|
32
|
+
self.val = val
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def PlotArea():
|
|
36
|
+
from .chartspace import PlotArea
|
|
37
|
+
return PlotArea()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class ChartBase(Serialisable):
|
|
41
|
+
|
|
42
|
+
"""
|
|
43
|
+
Base class for all charts
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
legend = Typed(expected_type=Legend, allow_none=True)
|
|
47
|
+
layout = Typed(expected_type=Layout, allow_none=True)
|
|
48
|
+
roundedCorners = Bool(allow_none=True)
|
|
49
|
+
axId = ValueSequence(expected_type=int)
|
|
50
|
+
visible_cells_only = Bool(allow_none=True)
|
|
51
|
+
display_blanks = Set(values=['span', 'gap', 'zero'])
|
|
52
|
+
graphical_properties = Typed(expected_type=GraphicalProperties, allow_none=True)
|
|
53
|
+
|
|
54
|
+
_series_type = ""
|
|
55
|
+
ser = ()
|
|
56
|
+
series = Alias('ser')
|
|
57
|
+
title = TitleDescriptor()
|
|
58
|
+
anchor = "E15" # default anchor position
|
|
59
|
+
width = 15 # in cm, approx 5 rows
|
|
60
|
+
height = 7.5 # in cm, approx 14 rows
|
|
61
|
+
_id = 1
|
|
62
|
+
_path = "/xl/charts/chart{0}.xml"
|
|
63
|
+
style = MinMax(allow_none=True, min=1, max=48)
|
|
64
|
+
mime_type = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml"
|
|
65
|
+
graphical_properties = Typed(expected_type=GraphicalProperties, allow_none=True) # mapped to chartspace
|
|
66
|
+
|
|
67
|
+
__elements__ = ()
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def __init__(self, axId=(), **kw):
|
|
71
|
+
self._charts = [self]
|
|
72
|
+
self.title = None
|
|
73
|
+
self.layout = None
|
|
74
|
+
self.roundedCorners = None
|
|
75
|
+
self.legend = Legend()
|
|
76
|
+
self.graphical_properties = None
|
|
77
|
+
self.style = None
|
|
78
|
+
self.plot_area = PlotArea()
|
|
79
|
+
self.axId = axId
|
|
80
|
+
self.display_blanks = 'gap'
|
|
81
|
+
self.pivotSource = None
|
|
82
|
+
self.pivotFormats = ()
|
|
83
|
+
self.visible_cells_only = True
|
|
84
|
+
self.idx_base = 0
|
|
85
|
+
self.graphical_properties = None
|
|
86
|
+
super().__init__()
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def __hash__(self):
|
|
90
|
+
"""
|
|
91
|
+
Just need to check for identity
|
|
92
|
+
"""
|
|
93
|
+
return id(self)
|
|
94
|
+
|
|
95
|
+
def __iadd__(self, other):
|
|
96
|
+
"""
|
|
97
|
+
Combine the chart with another one
|
|
98
|
+
"""
|
|
99
|
+
if not isinstance(other, ChartBase):
|
|
100
|
+
raise TypeError("Only other charts can be added")
|
|
101
|
+
self._charts.append(other)
|
|
102
|
+
return self
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def to_tree(self, namespace=None, tagname=None, idx=None):
|
|
106
|
+
self.axId = [id for id in self._axes]
|
|
107
|
+
if self.ser is not None:
|
|
108
|
+
for s in self.ser:
|
|
109
|
+
s.__elements__ = attribute_mapping[self._series_type]
|
|
110
|
+
return super().to_tree(tagname, idx)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def _reindex(self):
|
|
114
|
+
"""
|
|
115
|
+
Normalise and rebase series: sort by order and then rebase order
|
|
116
|
+
|
|
117
|
+
"""
|
|
118
|
+
# sort data series in order and rebase
|
|
119
|
+
ds = sorted(self.series, key=attrgetter("order"))
|
|
120
|
+
for idx, s in enumerate(ds):
|
|
121
|
+
s.order = idx
|
|
122
|
+
self.series = ds
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def _write(self):
|
|
126
|
+
from .chartspace import ChartSpace, ChartContainer
|
|
127
|
+
self.plot_area.layout = self.layout
|
|
128
|
+
|
|
129
|
+
idx_base = self.idx_base
|
|
130
|
+
for chart in self._charts:
|
|
131
|
+
if chart not in self.plot_area._charts:
|
|
132
|
+
chart.idx_base = idx_base
|
|
133
|
+
idx_base += len(chart.series)
|
|
134
|
+
self.plot_area._charts = self._charts
|
|
135
|
+
|
|
136
|
+
container = ChartContainer(plotArea=self.plot_area, legend=self.legend, title=self.title)
|
|
137
|
+
if isinstance(chart, _3DBase):
|
|
138
|
+
container.view3D = chart.view3D
|
|
139
|
+
container.floor = chart.floor
|
|
140
|
+
container.sideWall = chart.sideWall
|
|
141
|
+
container.backWall = chart.backWall
|
|
142
|
+
container.plotVisOnly = self.visible_cells_only
|
|
143
|
+
container.dispBlanksAs = self.display_blanks
|
|
144
|
+
container.pivotFmts = self.pivotFormats
|
|
145
|
+
cs = ChartSpace(chart=container)
|
|
146
|
+
cs.style = self.style
|
|
147
|
+
cs.roundedCorners = self.roundedCorners
|
|
148
|
+
cs.pivotSource = self.pivotSource
|
|
149
|
+
cs.spPr = self.graphical_properties
|
|
150
|
+
return cs.to_tree()
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
@property
|
|
154
|
+
def _axes(self):
|
|
155
|
+
x = getattr(self, "x_axis", None)
|
|
156
|
+
y = getattr(self, "y_axis", None)
|
|
157
|
+
z = getattr(self, "z_axis", None)
|
|
158
|
+
return OrderedDict([(axis.axId, axis) for axis in (x, y, z) if axis])
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def set_categories(self, labels):
|
|
162
|
+
"""
|
|
163
|
+
Set the categories / x-axis values
|
|
164
|
+
"""
|
|
165
|
+
if not isinstance(labels, Reference):
|
|
166
|
+
labels = Reference(range_string=labels)
|
|
167
|
+
for s in self.ser:
|
|
168
|
+
s.cat = AxDataSource(numRef=NumRef(f=labels))
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def add_data(self, data, from_rows=False, titles_from_data=False):
|
|
172
|
+
"""
|
|
173
|
+
Add a range of data in a single pass.
|
|
174
|
+
The default is to treat each column as a data series.
|
|
175
|
+
"""
|
|
176
|
+
if not isinstance(data, Reference):
|
|
177
|
+
data = Reference(range_string=data)
|
|
178
|
+
|
|
179
|
+
if from_rows:
|
|
180
|
+
values = data.rows
|
|
181
|
+
|
|
182
|
+
else:
|
|
183
|
+
values = data.cols
|
|
184
|
+
|
|
185
|
+
for ref in values:
|
|
186
|
+
series = SeriesFactory(ref, title_from_data=titles_from_data)
|
|
187
|
+
self.series.append(series)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def append(self, value):
|
|
191
|
+
"""Append a data series to the chart"""
|
|
192
|
+
l = self.series[:]
|
|
193
|
+
l.append(value)
|
|
194
|
+
self.series = l
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
@property
|
|
198
|
+
def path(self):
|
|
199
|
+
return self._path.format(self._id)
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Copyright (c) 2010-2024 openpyxl
|
|
2
|
+
|
|
3
|
+
from openpyxl.descriptors.serialisable import Serialisable
|
|
4
|
+
from openpyxl.descriptors import (
|
|
5
|
+
Typed,
|
|
6
|
+
Set,
|
|
7
|
+
Bool,
|
|
8
|
+
Integer,
|
|
9
|
+
Sequence,
|
|
10
|
+
Alias,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
from openpyxl.descriptors.excel import ExtensionList
|
|
14
|
+
from openpyxl.descriptors.nested import (
|
|
15
|
+
NestedMinMax,
|
|
16
|
+
NestedSet,
|
|
17
|
+
NestedBool,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
from ._chart import ChartBase
|
|
21
|
+
from .descriptors import NestedGapAmount
|
|
22
|
+
from .axis import TextAxis, NumericAxis, SeriesAxis, ChartLines
|
|
23
|
+
from .label import DataLabelList
|
|
24
|
+
from .series import Series
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class _AreaChartBase(ChartBase):
|
|
28
|
+
|
|
29
|
+
grouping = NestedSet(values=(['percentStacked', 'standard', 'stacked']))
|
|
30
|
+
varyColors = NestedBool(nested=True, allow_none=True)
|
|
31
|
+
ser = Sequence(expected_type=Series, allow_none=True)
|
|
32
|
+
dLbls = Typed(expected_type=DataLabelList, allow_none=True)
|
|
33
|
+
dataLabels = Alias("dLbls")
|
|
34
|
+
dropLines = Typed(expected_type=ChartLines, allow_none=True)
|
|
35
|
+
|
|
36
|
+
_series_type = "area"
|
|
37
|
+
|
|
38
|
+
__elements__ = ('grouping', 'varyColors', 'ser', 'dLbls', 'dropLines')
|
|
39
|
+
|
|
40
|
+
def __init__(self,
|
|
41
|
+
grouping="standard",
|
|
42
|
+
varyColors=None,
|
|
43
|
+
ser=(),
|
|
44
|
+
dLbls=None,
|
|
45
|
+
dropLines=None,
|
|
46
|
+
):
|
|
47
|
+
self.grouping = grouping
|
|
48
|
+
self.varyColors = varyColors
|
|
49
|
+
self.ser = ser
|
|
50
|
+
self.dLbls = dLbls
|
|
51
|
+
self.dropLines = dropLines
|
|
52
|
+
super().__init__()
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class AreaChart(_AreaChartBase):
|
|
56
|
+
|
|
57
|
+
tagname = "areaChart"
|
|
58
|
+
|
|
59
|
+
grouping = _AreaChartBase.grouping
|
|
60
|
+
varyColors = _AreaChartBase.varyColors
|
|
61
|
+
ser = _AreaChartBase.ser
|
|
62
|
+
dLbls = _AreaChartBase.dLbls
|
|
63
|
+
dropLines = _AreaChartBase.dropLines
|
|
64
|
+
|
|
65
|
+
# chart properties actually used by containing classes
|
|
66
|
+
x_axis = Typed(expected_type=TextAxis)
|
|
67
|
+
y_axis = Typed(expected_type=NumericAxis)
|
|
68
|
+
|
|
69
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
70
|
+
|
|
71
|
+
__elements__ = _AreaChartBase.__elements__ + ('axId',)
|
|
72
|
+
|
|
73
|
+
def __init__(self,
|
|
74
|
+
axId=None,
|
|
75
|
+
extLst=None,
|
|
76
|
+
**kw
|
|
77
|
+
):
|
|
78
|
+
self.x_axis = TextAxis()
|
|
79
|
+
self.y_axis = NumericAxis()
|
|
80
|
+
super().__init__(**kw)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class AreaChart3D(AreaChart):
|
|
84
|
+
|
|
85
|
+
tagname = "area3DChart"
|
|
86
|
+
|
|
87
|
+
grouping = _AreaChartBase.grouping
|
|
88
|
+
varyColors = _AreaChartBase.varyColors
|
|
89
|
+
ser = _AreaChartBase.ser
|
|
90
|
+
dLbls = _AreaChartBase.dLbls
|
|
91
|
+
dropLines = _AreaChartBase.dropLines
|
|
92
|
+
|
|
93
|
+
gapDepth = NestedGapAmount()
|
|
94
|
+
|
|
95
|
+
x_axis = Typed(expected_type=TextAxis)
|
|
96
|
+
y_axis = Typed(expected_type=NumericAxis)
|
|
97
|
+
z_axis = Typed(expected_type=SeriesAxis, allow_none=True)
|
|
98
|
+
|
|
99
|
+
__elements__ = AreaChart.__elements__ + ('gapDepth', )
|
|
100
|
+
|
|
101
|
+
def __init__(self, gapDepth=None, **kw):
|
|
102
|
+
self.gapDepth = gapDepth
|
|
103
|
+
super(AreaChart3D, self).__init__(**kw)
|
|
104
|
+
self.x_axis = TextAxis()
|
|
105
|
+
self.y_axis = NumericAxis()
|
|
106
|
+
self.z_axis = SeriesAxis()
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
# Copyright (c) 2010-2024 openpyxl
|
|
2
|
+
|
|
3
|
+
from openpyxl.descriptors.serialisable import Serialisable
|
|
4
|
+
from openpyxl.descriptors import (
|
|
5
|
+
Typed,
|
|
6
|
+
Float,
|
|
7
|
+
NoneSet,
|
|
8
|
+
Bool,
|
|
9
|
+
Integer,
|
|
10
|
+
MinMax,
|
|
11
|
+
NoneSet,
|
|
12
|
+
Set,
|
|
13
|
+
String,
|
|
14
|
+
Alias,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
from openpyxl.descriptors.excel import (
|
|
18
|
+
ExtensionList,
|
|
19
|
+
Percentage,
|
|
20
|
+
_explicit_none,
|
|
21
|
+
)
|
|
22
|
+
from openpyxl.descriptors.nested import (
|
|
23
|
+
NestedValue,
|
|
24
|
+
NestedSet,
|
|
25
|
+
NestedBool,
|
|
26
|
+
NestedNoneSet,
|
|
27
|
+
NestedFloat,
|
|
28
|
+
NestedInteger,
|
|
29
|
+
NestedMinMax,
|
|
30
|
+
)
|
|
31
|
+
from openpyxl.xml.constants import CHART_NS
|
|
32
|
+
|
|
33
|
+
from .descriptors import NumberFormatDescriptor
|
|
34
|
+
from .layout import Layout
|
|
35
|
+
from .text import Text, RichText
|
|
36
|
+
from .shapes import GraphicalProperties
|
|
37
|
+
from .title import Title, TitleDescriptor
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class ChartLines(Serialisable):
|
|
41
|
+
|
|
42
|
+
tagname = "chartLines"
|
|
43
|
+
|
|
44
|
+
spPr = Typed(expected_type=GraphicalProperties, allow_none=True)
|
|
45
|
+
graphicalProperties = Alias('spPr')
|
|
46
|
+
|
|
47
|
+
def __init__(self, spPr=None):
|
|
48
|
+
self.spPr = spPr
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class Scaling(Serialisable):
|
|
52
|
+
|
|
53
|
+
tagname = "scaling"
|
|
54
|
+
|
|
55
|
+
logBase = NestedFloat(allow_none=True)
|
|
56
|
+
orientation = NestedSet(values=(['maxMin', 'minMax']))
|
|
57
|
+
max = NestedFloat(allow_none=True)
|
|
58
|
+
min = NestedFloat(allow_none=True)
|
|
59
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
60
|
+
|
|
61
|
+
__elements__ = ('logBase', 'orientation', 'max', 'min',)
|
|
62
|
+
|
|
63
|
+
def __init__(self,
|
|
64
|
+
logBase=None,
|
|
65
|
+
orientation="minMax",
|
|
66
|
+
max=None,
|
|
67
|
+
min=None,
|
|
68
|
+
extLst=None,
|
|
69
|
+
):
|
|
70
|
+
self.logBase = logBase
|
|
71
|
+
self.orientation = orientation
|
|
72
|
+
self.max = max
|
|
73
|
+
self.min = min
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class _BaseAxis(Serialisable):
|
|
77
|
+
|
|
78
|
+
axId = NestedInteger(expected_type=int)
|
|
79
|
+
scaling = Typed(expected_type=Scaling)
|
|
80
|
+
delete = NestedBool(allow_none=True)
|
|
81
|
+
axPos = NestedSet(values=(['b', 'l', 'r', 't']))
|
|
82
|
+
majorGridlines = Typed(expected_type=ChartLines, allow_none=True)
|
|
83
|
+
minorGridlines = Typed(expected_type=ChartLines, allow_none=True)
|
|
84
|
+
title = TitleDescriptor()
|
|
85
|
+
numFmt = NumberFormatDescriptor()
|
|
86
|
+
number_format = Alias("numFmt")
|
|
87
|
+
majorTickMark = NestedNoneSet(values=(['cross', 'in', 'out']), to_tree=_explicit_none)
|
|
88
|
+
minorTickMark = NestedNoneSet(values=(['cross', 'in', 'out']), to_tree=_explicit_none)
|
|
89
|
+
tickLblPos = NestedNoneSet(values=(['high', 'low', 'nextTo']))
|
|
90
|
+
spPr = Typed(expected_type=GraphicalProperties, allow_none=True)
|
|
91
|
+
graphicalProperties = Alias('spPr')
|
|
92
|
+
txPr = Typed(expected_type=RichText, allow_none=True)
|
|
93
|
+
textProperties = Alias('txPr')
|
|
94
|
+
crossAx = NestedInteger(expected_type=int) # references other axis
|
|
95
|
+
crosses = NestedNoneSet(values=(['autoZero', 'max', 'min']))
|
|
96
|
+
crossesAt = NestedFloat(allow_none=True)
|
|
97
|
+
|
|
98
|
+
# crosses & crossesAt are mutually exclusive
|
|
99
|
+
|
|
100
|
+
__elements__ = ('axId', 'scaling', 'delete', 'axPos', 'majorGridlines',
|
|
101
|
+
'minorGridlines', 'title', 'numFmt', 'majorTickMark', 'minorTickMark',
|
|
102
|
+
'tickLblPos', 'spPr', 'txPr', 'crossAx', 'crosses', 'crossesAt')
|
|
103
|
+
|
|
104
|
+
def __init__(self,
|
|
105
|
+
axId=None,
|
|
106
|
+
scaling=None,
|
|
107
|
+
delete=None,
|
|
108
|
+
axPos='l',
|
|
109
|
+
majorGridlines=None,
|
|
110
|
+
minorGridlines=None,
|
|
111
|
+
title=None,
|
|
112
|
+
numFmt=None,
|
|
113
|
+
majorTickMark=None,
|
|
114
|
+
minorTickMark=None,
|
|
115
|
+
tickLblPos=None,
|
|
116
|
+
spPr=None,
|
|
117
|
+
txPr= None,
|
|
118
|
+
crossAx=None,
|
|
119
|
+
crosses=None,
|
|
120
|
+
crossesAt=None,
|
|
121
|
+
):
|
|
122
|
+
self.axId = axId
|
|
123
|
+
if scaling is None:
|
|
124
|
+
scaling = Scaling()
|
|
125
|
+
self.scaling = scaling
|
|
126
|
+
self.delete = delete
|
|
127
|
+
self.axPos = axPos
|
|
128
|
+
self.majorGridlines = majorGridlines
|
|
129
|
+
self.minorGridlines = minorGridlines
|
|
130
|
+
self.title = title
|
|
131
|
+
self.numFmt = numFmt
|
|
132
|
+
self.majorTickMark = majorTickMark
|
|
133
|
+
self.minorTickMark = minorTickMark
|
|
134
|
+
self.tickLblPos = tickLblPos
|
|
135
|
+
self.spPr = spPr
|
|
136
|
+
self.txPr = txPr
|
|
137
|
+
self.crossAx = crossAx
|
|
138
|
+
self.crosses = crosses
|
|
139
|
+
self.crossesAt = crossesAt
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class DisplayUnitsLabel(Serialisable):
|
|
143
|
+
|
|
144
|
+
tagname = "dispUnitsLbl"
|
|
145
|
+
|
|
146
|
+
layout = Typed(expected_type=Layout, allow_none=True)
|
|
147
|
+
tx = Typed(expected_type=Text, allow_none=True)
|
|
148
|
+
text = Alias("tx")
|
|
149
|
+
spPr = Typed(expected_type=GraphicalProperties, allow_none=True)
|
|
150
|
+
graphicalProperties = Alias("spPr")
|
|
151
|
+
txPr = Typed(expected_type=RichText, allow_none=True)
|
|
152
|
+
textPropertes = Alias("txPr")
|
|
153
|
+
|
|
154
|
+
__elements__ = ('layout', 'tx', 'spPr', 'txPr')
|
|
155
|
+
|
|
156
|
+
def __init__(self,
|
|
157
|
+
layout=None,
|
|
158
|
+
tx=None,
|
|
159
|
+
spPr=None,
|
|
160
|
+
txPr=None,
|
|
161
|
+
):
|
|
162
|
+
self.layout = layout
|
|
163
|
+
self.tx = tx
|
|
164
|
+
self.spPr = spPr
|
|
165
|
+
self.txPr = txPr
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class DisplayUnitsLabelList(Serialisable):
|
|
169
|
+
|
|
170
|
+
tagname = "dispUnits"
|
|
171
|
+
|
|
172
|
+
custUnit = NestedFloat(allow_none=True)
|
|
173
|
+
builtInUnit = NestedNoneSet(values=(['hundreds', 'thousands',
|
|
174
|
+
'tenThousands', 'hundredThousands', 'millions', 'tenMillions',
|
|
175
|
+
'hundredMillions', 'billions', 'trillions']))
|
|
176
|
+
dispUnitsLbl = Typed(expected_type=DisplayUnitsLabel, allow_none=True)
|
|
177
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
178
|
+
|
|
179
|
+
__elements__ = ('custUnit', 'builtInUnit', 'dispUnitsLbl',)
|
|
180
|
+
|
|
181
|
+
def __init__(self,
|
|
182
|
+
custUnit=None,
|
|
183
|
+
builtInUnit=None,
|
|
184
|
+
dispUnitsLbl=None,
|
|
185
|
+
extLst=None,
|
|
186
|
+
):
|
|
187
|
+
self.custUnit = custUnit
|
|
188
|
+
self.builtInUnit = builtInUnit
|
|
189
|
+
self.dispUnitsLbl = dispUnitsLbl
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class NumericAxis(_BaseAxis):
|
|
193
|
+
|
|
194
|
+
tagname = "valAx"
|
|
195
|
+
|
|
196
|
+
axId = _BaseAxis.axId
|
|
197
|
+
scaling = _BaseAxis.scaling
|
|
198
|
+
delete = _BaseAxis.delete
|
|
199
|
+
axPos = _BaseAxis.axPos
|
|
200
|
+
majorGridlines = _BaseAxis.majorGridlines
|
|
201
|
+
minorGridlines = _BaseAxis.minorGridlines
|
|
202
|
+
title = _BaseAxis.title
|
|
203
|
+
numFmt = _BaseAxis.numFmt
|
|
204
|
+
majorTickMark = _BaseAxis.majorTickMark
|
|
205
|
+
minorTickMark = _BaseAxis.minorTickMark
|
|
206
|
+
tickLblPos = _BaseAxis.tickLblPos
|
|
207
|
+
spPr = _BaseAxis.spPr
|
|
208
|
+
txPr = _BaseAxis.txPr
|
|
209
|
+
crossAx = _BaseAxis.crossAx
|
|
210
|
+
crosses = _BaseAxis.crosses
|
|
211
|
+
crossesAt = _BaseAxis.crossesAt
|
|
212
|
+
|
|
213
|
+
crossBetween = NestedNoneSet(values=(['between', 'midCat']))
|
|
214
|
+
majorUnit = NestedFloat(allow_none=True)
|
|
215
|
+
minorUnit = NestedFloat(allow_none=True)
|
|
216
|
+
dispUnits = Typed(expected_type=DisplayUnitsLabelList, allow_none=True)
|
|
217
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
218
|
+
|
|
219
|
+
__elements__ = _BaseAxis.__elements__ + ('crossBetween', 'majorUnit',
|
|
220
|
+
'minorUnit', 'dispUnits',)
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def __init__(self,
|
|
224
|
+
crossBetween=None,
|
|
225
|
+
majorUnit=None,
|
|
226
|
+
minorUnit=None,
|
|
227
|
+
dispUnits=None,
|
|
228
|
+
extLst=None,
|
|
229
|
+
**kw
|
|
230
|
+
):
|
|
231
|
+
self.crossBetween = crossBetween
|
|
232
|
+
self.majorUnit = majorUnit
|
|
233
|
+
self.minorUnit = minorUnit
|
|
234
|
+
self.dispUnits = dispUnits
|
|
235
|
+
kw.setdefault('majorGridlines', ChartLines())
|
|
236
|
+
kw.setdefault('axId', 100)
|
|
237
|
+
kw.setdefault('crossAx', 10)
|
|
238
|
+
super().__init__(**kw)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
@classmethod
|
|
242
|
+
def from_tree(cls, node):
|
|
243
|
+
"""
|
|
244
|
+
Special case value axes with no gridlines
|
|
245
|
+
"""
|
|
246
|
+
self = super().from_tree(node)
|
|
247
|
+
gridlines = node.find("{%s}majorGridlines" % CHART_NS)
|
|
248
|
+
if gridlines is None:
|
|
249
|
+
self.majorGridlines = None
|
|
250
|
+
return self
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
class TextAxis(_BaseAxis):
|
|
255
|
+
|
|
256
|
+
tagname = "catAx"
|
|
257
|
+
|
|
258
|
+
axId = _BaseAxis.axId
|
|
259
|
+
scaling = _BaseAxis.scaling
|
|
260
|
+
delete = _BaseAxis.delete
|
|
261
|
+
axPos = _BaseAxis.axPos
|
|
262
|
+
majorGridlines = _BaseAxis.majorGridlines
|
|
263
|
+
minorGridlines = _BaseAxis.minorGridlines
|
|
264
|
+
title = _BaseAxis.title
|
|
265
|
+
numFmt = _BaseAxis.numFmt
|
|
266
|
+
majorTickMark = _BaseAxis.majorTickMark
|
|
267
|
+
minorTickMark = _BaseAxis.minorTickMark
|
|
268
|
+
tickLblPos = _BaseAxis.tickLblPos
|
|
269
|
+
spPr = _BaseAxis.spPr
|
|
270
|
+
txPr = _BaseAxis.txPr
|
|
271
|
+
crossAx = _BaseAxis.crossAx
|
|
272
|
+
crosses = _BaseAxis.crosses
|
|
273
|
+
crossesAt = _BaseAxis.crossesAt
|
|
274
|
+
|
|
275
|
+
auto = NestedBool(allow_none=True)
|
|
276
|
+
lblAlgn = NestedNoneSet(values=(['ctr', 'l', 'r']))
|
|
277
|
+
lblOffset = NestedMinMax(min=0, max=1000)
|
|
278
|
+
tickLblSkip = NestedInteger(allow_none=True)
|
|
279
|
+
tickMarkSkip = NestedInteger(allow_none=True)
|
|
280
|
+
noMultiLvlLbl = NestedBool(allow_none=True)
|
|
281
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
282
|
+
|
|
283
|
+
__elements__ = _BaseAxis.__elements__ + ('auto', 'lblAlgn', 'lblOffset',
|
|
284
|
+
'tickLblSkip', 'tickMarkSkip', 'noMultiLvlLbl')
|
|
285
|
+
|
|
286
|
+
def __init__(self,
|
|
287
|
+
auto=None,
|
|
288
|
+
lblAlgn=None,
|
|
289
|
+
lblOffset=100,
|
|
290
|
+
tickLblSkip=None,
|
|
291
|
+
tickMarkSkip=None,
|
|
292
|
+
noMultiLvlLbl=None,
|
|
293
|
+
extLst=None,
|
|
294
|
+
**kw
|
|
295
|
+
):
|
|
296
|
+
self.auto = auto
|
|
297
|
+
self.lblAlgn = lblAlgn
|
|
298
|
+
self.lblOffset = lblOffset
|
|
299
|
+
self.tickLblSkip = tickLblSkip
|
|
300
|
+
self.tickMarkSkip = tickMarkSkip
|
|
301
|
+
self.noMultiLvlLbl = noMultiLvlLbl
|
|
302
|
+
kw.setdefault('axId', 10)
|
|
303
|
+
kw.setdefault('crossAx', 100)
|
|
304
|
+
super().__init__(**kw)
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
class DateAxis(TextAxis):
|
|
308
|
+
|
|
309
|
+
tagname = "dateAx"
|
|
310
|
+
|
|
311
|
+
axId = _BaseAxis.axId
|
|
312
|
+
scaling = _BaseAxis.scaling
|
|
313
|
+
delete = _BaseAxis.delete
|
|
314
|
+
axPos = _BaseAxis.axPos
|
|
315
|
+
majorGridlines = _BaseAxis.majorGridlines
|
|
316
|
+
minorGridlines = _BaseAxis.minorGridlines
|
|
317
|
+
title = _BaseAxis.title
|
|
318
|
+
numFmt = _BaseAxis.numFmt
|
|
319
|
+
majorTickMark = _BaseAxis.majorTickMark
|
|
320
|
+
minorTickMark = _BaseAxis.minorTickMark
|
|
321
|
+
tickLblPos = _BaseAxis.tickLblPos
|
|
322
|
+
spPr = _BaseAxis.spPr
|
|
323
|
+
txPr = _BaseAxis.txPr
|
|
324
|
+
crossAx = _BaseAxis.crossAx
|
|
325
|
+
crosses = _BaseAxis.crosses
|
|
326
|
+
crossesAt = _BaseAxis.crossesAt
|
|
327
|
+
|
|
328
|
+
auto = NestedBool(allow_none=True)
|
|
329
|
+
lblOffset = NestedInteger(allow_none=True)
|
|
330
|
+
baseTimeUnit = NestedNoneSet(values=(['days', 'months', 'years']))
|
|
331
|
+
majorUnit = NestedFloat(allow_none=True)
|
|
332
|
+
majorTimeUnit = NestedNoneSet(values=(['days', 'months', 'years']))
|
|
333
|
+
minorUnit = NestedFloat(allow_none=True)
|
|
334
|
+
minorTimeUnit = NestedNoneSet(values=(['days', 'months', 'years']))
|
|
335
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
336
|
+
|
|
337
|
+
__elements__ = _BaseAxis.__elements__ + ('auto', 'lblOffset',
|
|
338
|
+
'baseTimeUnit', 'majorUnit', 'majorTimeUnit', 'minorUnit',
|
|
339
|
+
'minorTimeUnit')
|
|
340
|
+
|
|
341
|
+
def __init__(self,
|
|
342
|
+
auto=None,
|
|
343
|
+
lblOffset=None,
|
|
344
|
+
baseTimeUnit=None,
|
|
345
|
+
majorUnit=None,
|
|
346
|
+
majorTimeUnit=None,
|
|
347
|
+
minorUnit=None,
|
|
348
|
+
minorTimeUnit=None,
|
|
349
|
+
extLst=None,
|
|
350
|
+
**kw
|
|
351
|
+
):
|
|
352
|
+
self.auto = auto
|
|
353
|
+
self.lblOffset = lblOffset
|
|
354
|
+
self.baseTimeUnit = baseTimeUnit
|
|
355
|
+
self.majorUnit = majorUnit
|
|
356
|
+
self.majorTimeUnit = majorTimeUnit
|
|
357
|
+
self.minorUnit = minorUnit
|
|
358
|
+
self.minorTimeUnit = minorTimeUnit
|
|
359
|
+
kw.setdefault('axId', 500)
|
|
360
|
+
kw.setdefault('lblOffset', lblOffset)
|
|
361
|
+
super().__init__(**kw)
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
class SeriesAxis(_BaseAxis):
|
|
365
|
+
|
|
366
|
+
tagname = "serAx"
|
|
367
|
+
|
|
368
|
+
axId = _BaseAxis.axId
|
|
369
|
+
scaling = _BaseAxis.scaling
|
|
370
|
+
delete = _BaseAxis.delete
|
|
371
|
+
axPos = _BaseAxis.axPos
|
|
372
|
+
majorGridlines = _BaseAxis.majorGridlines
|
|
373
|
+
minorGridlines = _BaseAxis.minorGridlines
|
|
374
|
+
title = _BaseAxis.title
|
|
375
|
+
numFmt = _BaseAxis.numFmt
|
|
376
|
+
majorTickMark = _BaseAxis.majorTickMark
|
|
377
|
+
minorTickMark = _BaseAxis.minorTickMark
|
|
378
|
+
tickLblPos = _BaseAxis.tickLblPos
|
|
379
|
+
spPr = _BaseAxis.spPr
|
|
380
|
+
txPr = _BaseAxis.txPr
|
|
381
|
+
crossAx = _BaseAxis.crossAx
|
|
382
|
+
crosses = _BaseAxis.crosses
|
|
383
|
+
crossesAt = _BaseAxis.crossesAt
|
|
384
|
+
|
|
385
|
+
tickLblSkip = NestedInteger(allow_none=True)
|
|
386
|
+
tickMarkSkip = NestedInteger(allow_none=True)
|
|
387
|
+
extLst = Typed(expected_type=ExtensionList, allow_none=True)
|
|
388
|
+
|
|
389
|
+
__elements__ = _BaseAxis.__elements__ + ('tickLblSkip', 'tickMarkSkip')
|
|
390
|
+
|
|
391
|
+
def __init__(self,
|
|
392
|
+
tickLblSkip=None,
|
|
393
|
+
tickMarkSkip=None,
|
|
394
|
+
extLst=None,
|
|
395
|
+
**kw
|
|
396
|
+
):
|
|
397
|
+
self.tickLblSkip = tickLblSkip
|
|
398
|
+
self.tickMarkSkip = tickMarkSkip
|
|
399
|
+
kw.setdefault('axId', 1000)
|
|
400
|
+
kw.setdefault('crossAx', 10)
|
|
401
|
+
super().__init__(**kw)
|