@Override
	public void paintComponent (Graphics g) {
		super.paintComponent (g);
		Graphics2D g2 = (Graphics2D) g;
		g2.setRenderingHint (RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
		for (Line2D.Float l : xAxis) {
			g2.draw (l);
		}
		for (Line2D.Float l : yAxis) {
			g2.draw (l);
		}
		drawStringFromBack (g2, xLabel, width - border, height - border + 5);
		drawStringFromBack (g2, yLabel, border + padding - 5, border + 7);
		drawCenteredString (g2, title, width / 2, border);

		autoScaleAxis ();

		//Draw graphs
		for (int i = 0; i < dataCollectors.length; i++) {
			ArrayList<Float> buffer = buffers[i];
			int[] yCoords = new int[buffer.size ()];
			for (int j = 0; j < buffer.size (); j++) {
				yCoords[j] = height - padding - border - (int) (buffer.get (j) / maxY * (graphHeight));
			}

			g2.setColor (dataCollectors[i].getColor ());
			g2.drawPolyline (xCoords, yCoords, yCoords.length < bufferSize ? yCoords.length : bufferSize);
		}

		//Draw trendlines
		for (int i = 0; i < dataCollectors.length; i++) {
			ArrayList<Float> buffer = trendBuffers[i];
			int[] yCoords = new int[buffer.size ()];
			for (int j = 0; j < buffer.size (); j++) {
				yCoords[j] = height - padding - border - (int) (buffer.get (j) / maxY * (graphHeight));
			}

			g2.setColor (Color.YELLOW);
			g2.drawPolyline (xCoords, yCoords, yCoords.length < bufferSize ? yCoords.length : bufferSize);
			g2.setColor (Color.BLACK);
			if (buffer.size () >= 1) {
				drawStringFromBack (g2, df.format (buffer.get (buffer.size () - 1)), xCoords[buffer.size ()], yCoords[yCoords.length - 1] - 5);
			}
		}
	}