Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/openpyxl/chart/surface_chart.py: 77%
64 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 Integer,
7 Bool,
8 Alias,
9 Sequence,
10)
11from openpyxl.descriptors.excel import ExtensionList
12from openpyxl.descriptors.nested import (
13 NestedInteger,
14 NestedBool,
15)
17from ._chart import ChartBase
18from ._3d import _3DBase
19from .axis import TextAxis, NumericAxis, SeriesAxis
20from .shapes import GraphicalProperties
21from .series import Series
24class BandFormat(Serialisable):
26 tagname = "bandFmt"
28 idx = NestedInteger()
29 spPr = Typed(expected_type=GraphicalProperties, allow_none=True)
30 graphicalProperties = Alias("spPr")
32 __elements__ = ('idx', 'spPr')
34 def __init__(self,
35 idx=0,
36 spPr=None,
37 ):
38 self.idx = idx
39 self.spPr = spPr
42class BandFormatList(Serialisable):
44 tagname = "bandFmts"
46 bandFmt = Sequence(expected_type=BandFormat, allow_none=True)
48 __elements__ = ('bandFmt',)
50 def __init__(self,
51 bandFmt=(),
52 ):
53 self.bandFmt = bandFmt
56class _SurfaceChartBase(ChartBase):
58 wireframe = NestedBool(allow_none=True)
59 ser = Sequence(expected_type=Series, allow_none=True)
60 bandFmts = Typed(expected_type=BandFormatList, allow_none=True)
62 _series_type = "surface"
64 __elements__ = ('wireframe', 'ser', 'bandFmts')
66 def __init__(self,
67 wireframe=None,
68 ser=(),
69 bandFmts=None,
70 **kw
71 ):
72 self.wireframe = wireframe
73 self.ser = ser
74 self.bandFmts = bandFmts
75 super(_SurfaceChartBase, self).__init__(**kw)
78class SurfaceChart3D(_SurfaceChartBase, _3DBase):
80 tagname = "surface3DChart"
82 wireframe = _SurfaceChartBase.wireframe
83 ser = _SurfaceChartBase.ser
84 bandFmts = _SurfaceChartBase.bandFmts
86 extLst = Typed(expected_type=ExtensionList, allow_none=True)
88 x_axis = Typed(expected_type=TextAxis)
89 y_axis = Typed(expected_type=NumericAxis)
90 z_axis = Typed(expected_type=SeriesAxis)
92 __elements__ = _SurfaceChartBase.__elements__ + ('axId',)
94 def __init__(self, **kw):
95 self.x_axis = TextAxis()
96 self.y_axis = NumericAxis()
97 self.z_axis = SeriesAxis()
98 super(SurfaceChart3D, self).__init__(**kw)
101class SurfaceChart(SurfaceChart3D):
103 tagname = "surfaceChart"
105 wireframe = _SurfaceChartBase.wireframe
106 ser = _SurfaceChartBase.ser
107 bandFmts = _SurfaceChartBase.bandFmts
109 extLst = Typed(expected_type=ExtensionList, allow_none=True)
111 __elements__ = SurfaceChart3D.__elements__
113 def __init__(self, **kw):
114 super(SurfaceChart, self).__init__(**kw)
115 self.y_axis.delete = True
116 self.view3D.x_rotation = 90
117 self.view3D.y_rotation = 0
118 self.view3D.perspective = False
119 self.view3D.right_angle_axes = False