Writes the series to an OmniCanvas canvas.

        :param Canvas canvas: The canvas to write to.
        :param str name: The name to give the line graphic on the canvas.

def write_to_canvas(self, canvas, name):
        """Writes the series to an OmniCanvas canvas.

        :param Canvas canvas: The canvas to write to.
        :param str name: The name to give the line graphic on the canvas."""

        points = self.canvas_points()
        args = []
        for point in points:
            args += list(point)
        canvas.add_polyline(
         *args, line_color=self.color(), line_style=self.linestyle(),
         line_width=self.linewidth(), name=name
        )