MCPcopy
hub / github.com/jmcnamara/XlsxWriter / ChartLine

Class ChartLine

xlsxwriter/chart_line.py:15–146  ·  view source on GitHub ↗

A class for writing the Excel XLSX Line charts.

Source from the content-addressed store, hash-verified

13
14
15class 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.

Callers 1

add_chartMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…