radar_chart.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright (c) 2010-2019 openpyxl
  2. from openpyxl.descriptors.serialisable import Serialisable
  3. from openpyxl.descriptors import (
  4. Sequence,
  5. Typed,
  6. Alias,
  7. )
  8. from openpyxl.descriptors.excel import ExtensionList
  9. from openpyxl.descriptors.nested import (
  10. NestedBool,
  11. NestedInteger,
  12. NestedSet
  13. )
  14. from ._chart import ChartBase
  15. from .axis import TextAxis, NumericAxis
  16. from .series import Series
  17. from .label import DataLabelList
  18. class RadarChart(ChartBase):
  19. tagname = "radarChart"
  20. radarStyle = NestedSet(values=(['standard', 'marker', 'filled']))
  21. type = Alias("radarStyle")
  22. varyColors = NestedBool(nested=True, allow_none=True)
  23. ser = Sequence(expected_type=Series, allow_none=True)
  24. dLbls = Typed(expected_type=DataLabelList, allow_none=True)
  25. dataLabels = Alias("dLbls")
  26. extLst = Typed(expected_type=ExtensionList, allow_none=True)
  27. _series_type = "radar"
  28. x_axis = Typed(expected_type=TextAxis)
  29. y_axis = Typed(expected_type=NumericAxis)
  30. __elements__ = ('radarStyle', 'varyColors', 'ser', 'dLbls', 'axId')
  31. def __init__(self,
  32. radarStyle="standard",
  33. varyColors=None,
  34. ser=(),
  35. dLbls=None,
  36. extLst=None,
  37. **kw
  38. ):
  39. self.radarStyle = radarStyle
  40. self.varyColors = varyColors
  41. self.ser = ser
  42. self.dLbls = dLbls
  43. self.x_axis = TextAxis()
  44. self.y_axis = NumericAxis()
  45. super(RadarChart, self).__init__(**kw)