protected Rectangle ForceSquare(Graphics g, Rectangle r) {
		Rectangle dr;
		int x = r.x;
		int y = r.y;
		int width = r.width;
		int height = r.height;

		double xrange = 0.0;
		double yrange = 0.0;
		double range;

		if (dataset == null | dataset.isEmpty())
			return r;

		// Force all the axis to have the same range. This of course means that anything other than one xaxis and
		// one yaxis is a bit pointless.
		for (Axis a : axis) {
			range = a.maximum - a.minimum;
			if (a.isVertical()) {
				yrange = Math.max(range, yrange);
			}
			else {
				xrange = Math.max(range, xrange);
			}
		}

		if (xrange <= 0 | yrange <= 0)
			return r;

		if (xrange > yrange)
			range = xrange;
		else range = yrange;

		for (Axis a : axis) {
			a.maximum = a.minimum + range;
		}

		// Get the new data rectangle
		dr = getDataRectangle(g, r);

		// Modify the data rectangle so that it is square.
		if (dr.width > dr.height) {
			x += (dr.width - dr.height) * 0.5;
			width -= dr.width - dr.height;
		}
		else {
			y += (dr.height - dr.width) * 0.5;
			height -= dr.height - dr.width;
		}

		return new Rectangle(x, y, width, height);

	}