def add_line(self, x1, y1, x2, y2, color, width, dasharray): connector = self.shapes.add_connector(MSO_CONNECTOR.STRAIGHT, Pt(x1), Pt(y1), Pt(x2), Pt(y2)) connector.ln = connector.get_or_add_ln() line = LineFormat(connector) line.width = Pt(width) line.fill.solid() line.fill.fore_color.rgb = RGBColor(*color) if dasharray == 1: line.dash_style = MSO_LINE.SQUARE_DOT elif dasharray == 2: line.dash_style = MSO_LINE.DASH
def add_line(self, x1, y1, x2, y2, color, width, dasharray): connector = self.shapes.add_connector(MSO_CONNECTOR.STRAIGHT, Pt(x1), Pt(y1), Pt(x2), Pt(y2)) connector.ln = connector.get_or_add_ln() line = LineFormat(connector) line.width = width line.fill.solid() if color == "black": line.fill.fore_color.rgb = RGBColor(0, 0, 0) elif color == "blue": line.fill.fore_color.rgb = RGBColor(0, 0, 255) if dasharray != "none": line.dash_style = MSO_LINE.DASH