Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/openpyxl/chart/area_chart.py: 78%
58 statements
« prev ^ index » next coverage.py v6.4.4, created at 2023-07-17 14:22 -0600
« prev ^ index » next coverage.py v6.4.4, created at 2023-07-17 14:22 -0600
1# Copyright (c) 2010-2022 openpyxl
3from openpyxl.descriptors.serialisable import Serialisable
4from openpyxl.descriptors import (
5 Typed,
6 Set,
7 Bool,
8 Integer,
9 Sequence,
10 Alias,
11)
13from openpyxl.descriptors.excel import ExtensionList
14from openpyxl.descriptors.nested import (
15 NestedMinMax,
16 NestedSet,
17 NestedBool,
18)
20from ._chart import ChartBase
21from .descriptors import NestedGapAmount
22from .axis import TextAxis, NumericAxis, SeriesAxis, ChartLines
23from .label import DataLabelList
24from .series import Series
27class _AreaChartBase(ChartBase):
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)
36 _series_type = "area"
38 __elements__ = ('grouping', 'varyColors', 'ser', 'dLbls', 'dropLines')
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(_AreaChartBase, self).__init__()
55class AreaChart(_AreaChartBase):
57 tagname = "areaChart"
59 grouping = _AreaChartBase.grouping
60 varyColors = _AreaChartBase.varyColors
61 ser = _AreaChartBase.ser
62 dLbls = _AreaChartBase.dLbls
63 dropLines = _AreaChartBase.dropLines
65 # chart properties actually used by containing classes
66 x_axis = Typed(expected_type=TextAxis)
67 y_axis = Typed(expected_type=NumericAxis)
69 extLst = Typed(expected_type=ExtensionList, allow_none=True)
71 __elements__ = _AreaChartBase.__elements__ + ('axId',)
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(AreaChart, self).__init__(**kw)
83class AreaChart3D(AreaChart):
85 tagname = "area3DChart"
87 grouping = _AreaChartBase.grouping
88 varyColors = _AreaChartBase.varyColors
89 ser = _AreaChartBase.ser
90 dLbls = _AreaChartBase.dLbls
91 dropLines = _AreaChartBase.dropLines
93 gapDepth = NestedGapAmount()
95 x_axis = Typed(expected_type=TextAxis)
96 y_axis = Typed(expected_type=NumericAxis)
97 z_axis = Typed(expected_type=SeriesAxis, allow_none=True)
99 __elements__ = AreaChart.__elements__ + ('gapDepth', )
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()