private void setGrid(int xType, int yType) {

		// update the axis types
		setXAxis(xType);
		setYAxis(yType);

		// update the number of rows and columns
		int xNum = xAxisLabel.size();
		int yNum = yAxisLabel.size();
		gridPanel.removeAll();

		// //update the grid panel to reflect the number of columns
		// gridPanel.setLayout(new GridLayout(0,xNum+1));
		//		
		// //update the cells array to the row and column sizes
		// cells = new GridCell[xNum][yNum];
		//		
		// //populate each cell based on the matching query results
		// //and the appropriate x and y category for the cell
		// for(int i=0; i<xNum; i++){
		// for(int j=0; j<yNum; j++){
		// cells[i][j]= new GridCell(searchMatch.getSubset(xType,
		// xAxisLabel.get(i), yType, yAxisLabel.get(j)));
		// }
		// }
		// //Add the cells to the empty gridPanel
		// for(int j=yNum-1; j>=0; j--){
		// //add y axis label
		// gridPanel.add(axisLabel(yAxisLabel.get(j)));
		// for(int i=0; i<xNum; i++){
		// gridPanel.add(cells[i][j]);
		// }
		// }
		// update the grid panel to reflect the number of columns
		if (chkVis.isSelected()) {
			gridPanel.setLayout(new GridBagLayout());
			GridBagConstraints gbc = new GridBagConstraints();
			gbc.fill = GridBagConstraints.BOTH;
			gbc.anchor = GridBagConstraints.CENTER;
			gbc.weightx = 1.0;
			gbc.weighty = 1.0;
			// update the cells array to the row and column sizes
			cells = new GridCell[xNum][yNum];

			// populate each cell based on the matching query results
			// and the appropriate x and y category for the cell
			for (int i = 0; i < xNum; i++) {
				for (int j = 0; j < yNum; j++) {
					cells[i][j] = new GridCell(repository.getBookData().getSubset(xType,
							xAxisLabel.get(i), yType, yAxisLabel.get(j)));
				}
			}
			// Add the cells to the empty gridPanel
			for (int j = yNum - 1; j >= 0; j--) {
				// add y axis label
				gbc.gridx = 0;
				gbc.gridy = j;
				gridPanel.add(axisLabel(yAxisLabel.get(j)), gbc);
				for (int i = 0; i < xNum; i++) {
					gbc.gridx = i + 1;
					gbc.gridy = j;
					gridPanel.add(cells[i][j], gbc);
				}
			}
			// add x axis labels
			gridPanel.add(new JLabel(""));
			for (int i = 0; i < xNum; i++) {
				gbc.gridx = i + 1;
				gbc.gridy = yNum;
				gridPanel.add(axisLabel(xAxisLabel.get(i)), gbc);
			}
		} else {
			JLabel text = new JLabel(searchMatch.getTextView(yType));
			text.setBackground(Color.white);
			text.setForeground(Color.black);
			JScrollPane sp = new JScrollPane(text);
			sp.setBackground(Color.white);
			gridPanel.add(sp);
		}
	}