 			reportError(e);
 		}
 		
-		task.buffer.draw(shape);
-		
+		renderer.flush(task.buffer);
 		return 1;
 	}
-}+}
+
+internal class AsyncLineRenderer
+{
+	public function AsyncLineRenderer()
+	{
+		shape = new Shape();
+		graphics = shape.graphics;
+	}
+	
+	private var shape:Shape;
+	private var graphics:Graphics;
+	private var handlePoint:Function;
+	private var prevX:Number;
+	private var prevY:Number;
+	private var continueLine:Boolean;
+	private var prevLineStyle:Array;
+	
+	/**
+	 * Call this at the beginning of the async task
+	 */
+	public function reset():void
+	{
+		graphics.clear();
+		newLine();
+	}
+	
+	/**
+	 * Call this before starting a new line
+	 */
+	public function newLine():void
+	{
+		continueLine = false;
+	}
+	
+	/**
+	 * Call this for each coordinate in the line, whether the coordinates are defined or not.
+	 */
+	public function addPoint(x:Number, y:Number, lineStyleParams:Array):void
+	{
+		var isDefined:Boolean = isFinite(x) && isFinite(y);
+		
+		if (isDefined && continueLine)
+		{
+			var midX:Number = (prevX + x) / 2;
+			var midY:Number = (prevY + y) / 2;
+			
+			graphics.lineStyle.apply(graphics, prevLineStyle);
+			graphics.lineTo(midX, midY);
+			graphics.lineStyle.apply(graphics, lineStyleParams);
+			graphics.lineTo(x, y);
+		}
+		else
+		{
+			graphics.moveTo(x, y);
+		}
+		
+		prevX = x;
+		prevY = y;
+		continueLine = isDefined;
+		prevLineStyle = lineStyleParams;
+	}
+	
+	/**
+	 * Call this to flush the graphics to a BitmapData buffer.
+	 */
+	public function flush(buffer:BitmapData):void
+	{
+		buffer.draw(shape);
+		graphics.clear();
+		if (continueLine)
+			graphics.moveTo(prevX, prevY);
+	}
+}

		
		try
		{
			graphics.clear();
			graphics.moveTo(point.x, point.y);
			plotter.lineStyle.beginLineStyle(null, graphics);
			
			for (; keyIndex < keys.length; keyIndex++)
			{
				if (getTimer() > task.iterationStopTime)
				{
					task.buffer.draw(shape);
					return keyIndex / keys.length;
				}
				

		this.plotter = plotter;
		this.task = task;
		this.unfilteredKeySet = unfilteredKeySet;
		this.renderer = new AsyncLineRenderer();
		
		if ((task as PlotTask).taskType != PlotTask.TASK_TYPE_SUBSET)
			this.keySet = newDisposableChild(plotter, KeySet);
	}
	
	public var renderer:AsyncLineRenderer;
	public var plotter:LineChartPlotter;
	public var task:IPlotTask;
	public var unfilteredKeySet:IKeySet;
	public var keys:Array;
	public var keyIndex:Number;
	public var keySet:KeySet;
	public var group:Number;
	
	private static const tempPoint:Point = new Point();
	
	public function iterate():Number
	{
		if (task.iteration == 0)
		{
			renderer.reset();
			if (keySet)
			{
				keySet.clearKeys();
