line_chart.py 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #Autogenerated schema
  2. from openpyxl.descriptors import (
  3. Typed,
  4. Sequence,
  5. Alias,
  6. )
  7. from openpyxl.descriptors.excel import ExtensionList
  8. from openpyxl.descriptors.nested import (
  9. NestedSet,
  10. NestedBool,
  11. )
  12. from ._chart import ChartBase
  13. from .updown_bars import UpDownBars
  14. from .descriptors import NestedGapAmount
  15. from .axis import TextAxis, NumericAxis, SeriesAxis, ChartLines, _BaseAxis
  16. from .label import DataLabelList
  17. from .series import Series
  18. class _LineChartBase(ChartBase):
  19. grouping = NestedSet(values=(['percentStacked', 'standard', 'stacked']))
  20. varyColors = NestedBool(allow_none=True)
  21. ser = Sequence(expected_type=Series, allow_none=True)
  22. dLbls = Typed(expected_type=DataLabelList, allow_none=True)
  23. dataLabels = Alias("dLbls")
  24. dropLines = Typed(expected_type=ChartLines, allow_none=True)
  25. _series_type = "line"
  26. __elements__ = ('grouping', 'varyColors', 'ser', 'dLbls', 'dropLines')
  27. def __init__(self,
  28. grouping="standard",
  29. varyColors=None,
  30. ser=(),
  31. dLbls=None,
  32. dropLines=None,
  33. **kw
  34. ):
  35. self.grouping = grouping
  36. self.varyColors = varyColors
  37. self.ser = ser
  38. self.dLbls = dLbls
  39. self.dropLines = dropLines
  40. super().__init__(**kw)
  41. class LineChart(_LineChartBase):
  42. tagname = "lineChart"
  43. grouping = _LineChartBase.grouping
  44. varyColors = _LineChartBase.varyColors
  45. ser = _LineChartBase.ser
  46. dLbls = _LineChartBase.dLbls
  47. dropLines =_LineChartBase.dropLines
  48. hiLowLines = Typed(expected_type=ChartLines, allow_none=True)
  49. upDownBars = Typed(expected_type=UpDownBars, allow_none=True)
  50. marker = NestedBool(allow_none=True)
  51. smooth = NestedBool(allow_none=True)
  52. extLst = Typed(expected_type=ExtensionList, allow_none=True)
  53. x_axis = Typed(expected_type=_BaseAxis)
  54. y_axis = Typed(expected_type=NumericAxis)
  55. __elements__ = _LineChartBase.__elements__ + ('hiLowLines', 'upDownBars', 'marker', 'smooth', 'axId')
  56. def __init__(self,
  57. hiLowLines=None,
  58. upDownBars=None,
  59. marker=None,
  60. smooth=None,
  61. extLst=None,
  62. **kw
  63. ):
  64. self.hiLowLines = hiLowLines
  65. self.upDownBars = upDownBars
  66. self.marker = marker
  67. self.smooth = smooth
  68. self.x_axis = TextAxis()
  69. self.y_axis = NumericAxis()
  70. super().__init__(**kw)
  71. class LineChart3D(_LineChartBase):
  72. tagname = "line3DChart"
  73. grouping = _LineChartBase.grouping
  74. varyColors = _LineChartBase.varyColors
  75. ser = _LineChartBase.ser
  76. dLbls = _LineChartBase.dLbls
  77. dropLines =_LineChartBase.dropLines
  78. gapDepth = NestedGapAmount()
  79. hiLowLines = Typed(expected_type=ChartLines, allow_none=True)
  80. upDownBars = Typed(expected_type=UpDownBars, allow_none=True)
  81. marker = NestedBool(allow_none=True)
  82. smooth = NestedBool(allow_none=True)
  83. extLst = Typed(expected_type=ExtensionList, allow_none=True)
  84. x_axis = Typed(expected_type=TextAxis)
  85. y_axis = Typed(expected_type=NumericAxis)
  86. z_axis = Typed(expected_type=SeriesAxis)
  87. __elements__ = _LineChartBase.__elements__ + ('gapDepth', 'hiLowLines',
  88. 'upDownBars', 'marker', 'smooth', 'axId')
  89. def __init__(self,
  90. gapDepth=None,
  91. hiLowLines=None,
  92. upDownBars=None,
  93. marker=None,
  94. smooth=None,
  95. **kw
  96. ):
  97. self.gapDepth = gapDepth
  98. self.hiLowLines = hiLowLines
  99. self.upDownBars = upDownBars
  100. self.marker = marker
  101. self.smooth = smooth
  102. self.x_axis = TextAxis()
  103. self.y_axis = NumericAxis()
  104. self.z_axis = SeriesAxis()
  105. super(LineChart3D, self).__init__(**kw)