A class for writing the Excel XLSX Line charts.
| 13 | |
| 14 | |
| 15 | class ChartLine(chart.Chart): |
| 16 | """ |
| 17 | A class for writing the Excel XLSX Line charts. |
| 18 | |
| 19 | |
| 20 | """ |
| 21 | |
| 22 | ########################################################################### |
| 23 | # |
| 24 | # Public API. |
| 25 | # |
| 26 | ########################################################################### |
| 27 | |
| 28 | def __init__(self, options: Optional[Dict[str, Any]] = None) -> None: |
| 29 | """ |
| 30 | Constructor. |
| 31 | |
| 32 | """ |
| 33 | super().__init__() |
| 34 | |
| 35 | if options is None: |
| 36 | options = {} |
| 37 | |
| 38 | self.subtype = options.get("subtype") |
| 39 | |
| 40 | if not self.subtype: |
| 41 | self.subtype = "standard" |
| 42 | |
| 43 | self.default_marker = {"type": "none"} |
| 44 | self.smooth_allowed = True |
| 45 | |
| 46 | # Override and reset the default axis values. |
| 47 | if self.subtype == "percent_stacked": |
| 48 | self.y_axis["defaults"]["num_format"] = "0%" |
| 49 | |
| 50 | # Set the available data label positions for this chart type. |
| 51 | self.label_position_default = "right" |
| 52 | self.label_positions = { |
| 53 | "center": "ctr", |
| 54 | "right": "r", |
| 55 | "left": "l", |
| 56 | "above": "t", |
| 57 | "below": "b", |
| 58 | # For backward compatibility. |
| 59 | "top": "t", |
| 60 | "bottom": "b", |
| 61 | } |
| 62 | |
| 63 | self.set_y_axis({}) |
| 64 | |
| 65 | ########################################################################### |
| 66 | # |
| 67 | # Private API. |
| 68 | # |
| 69 | ########################################################################### |
| 70 | |
| 71 | def _write_chart_type(self, args) -> None: |
| 72 | # Override the virtual superclass method with a chart specific method. |
no outgoing calls
no test coverage detected
searching dependent graphs…