public void mouseDragged(MouseEvent e) {

		if (xaxis == null || yaxis == null)
			return;

		x1 = e.getX();
		y1 = e.getY();

		if (drag) {

			if (x1 < datarect.x) {
				x1 = datarect.x;
			}
			else {
				if (x1 > datarect.x + datarect.width)
					x1 = datarect.x + datarect.width;
			}

			if (y1 < datarect.y) {
				y1 = datarect.y;
			}
			else {
				if (y1 > datarect.y + datarect.height)
					y1 = datarect.y + datarect.height;
			}

			if (cpgin != null && cpgin.isVisible()) {
				cpgin.setXlabel(xaxis.getDouble(x1));
				cpgin.setYlabel(yaxis.getDouble(y1));

			}

			repaint();

		}

	}