Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/openpyxl/chart/descriptors.py: 94%
18 statements
« prev ^ index » next coverage.py v7.3.3, created at 2023-12-20 06:34 +0000
« prev ^ index » next coverage.py v7.3.3, created at 2023-12-20 06:34 +0000
1# Copyright (c) 2010-2023 openpyxl
5from openpyxl.descriptors.nested import (
6 NestedMinMax
7 )
9from openpyxl.descriptors import Typed
11from .data_source import NumFmt
13"""
14Utility descriptors for the chart module.
15For convenience but also clarity.
16"""
18class NestedGapAmount(NestedMinMax):
20 allow_none = True
21 min = 0
22 max = 500
25class NestedOverlap(NestedMinMax):
27 allow_none = True
28 min = -100
29 max = 100
32class NumberFormatDescriptor(Typed):
33 """
34 Allow direct assignment of format code
35 """
37 expected_type = NumFmt
38 allow_none = True
40 def __set__(self, instance, value):
41 if isinstance(value, str):
42 value = NumFmt(value)
43 super(NumberFormatDescriptor, self).__set__(instance, value)