private void selectChart() {
    	Object[] possibilities = {"Circolar", "Rectangular", "Linear"};
    	String s = (String)JOptionPane.showInputDialog(
    	                    getMainFrame(),
    	                    "Choose the chart type:\n",
    	                    "Chart Shape",
    	                    JOptionPane.PLAIN_MESSAGE,
    	                    null,
    	                    possibilities,
    	                    "Rectangular");
    	
        String X = JOptionPane.showInputDialog(getMainFrame(), "Select Chart Width");
        String Y = JOptionPane.showInputDialog(getMainFrame(), "Select Chart Height");
        
        
    	if ((s != null) && (s.length() > 0)) {
    		if(s.equals("Circolar"))
    			try {
    			Game.getInstance().setChart(new CircolarChart(Integer.parseInt(X),Integer.parseInt(Y)));
    			}
    			catch (Exception e) {
        			Game.getInstance().setChart(new CircolarChart(10, 10));
				}
    		else if(s.equals("Rectangular"))
    			try {
    			Game.getInstance().setChart(new RectangularChart(Integer.parseInt(X),Integer.parseInt(Y)));
    			}
    			catch (Exception e) {
        			Game.getInstance().setChart(new RectangularChart(10,10));
    			}
    		else {
    			try {
    			Game.getInstance().setChart(new LinearChart(Integer.parseInt(X)));
    			}
    			catch (Exception e) {
        			Game.getInstance().setChart(new LinearChart(20));

				}
    		}
    	}
    	
    }