public void paintComponent(Graphics gfx) {
        super.paintComponent(gfx);      
        Graphics2D g = (Graphics2D) gfx;    
       
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
        RenderingHints.VALUE_ANTIALIAS_ON);
        g.setFont(font);
        
        //g.setColor(Color.gray);
        //g.drawRect (0,0,getWidth(), getHeight());
        
        g.setPaint(color);
        //Draw all the lines
        
        int px, py;
        for(int i = 0; i < (items.length); i++){
        	px = (int)p[i].x;
        	py = (int)p[i].y;
            //g.draw(lines[i]);
            //To make the lines thicker
            //g.drawLine((int)p[i].x - 1,  (int)p[i].y, (int)base[i].x - 1, (int)base[i].y);
            //g.drawLine((int)p[i].x - 2,  (int)p[i].y, (int)base[i].x - 2, (int)base[i].y);
            g.drawLine(px - 3, getHeight() - getBottom(), px - 3, py);
            //g.drawLine((int)p[i].x + 1,  (int)p[i].y, (int)base[i].x + 1, (int)base[i].y);
            g.drawLine( px + 2, getHeight() - getBottom(), px + 2, py );
        }
        
        Shape[] s;
        s = new Shape[items.length];
        String temp;
        g.setPaint(Color.DARK_GRAY);
        weights = ddomain.getWeights();
        for(int i = 0; i < items.length; i++){
            //Float test = new Float(((getHeight()-getBottom()) - p[i].y) / (getHeight()-15));
            temp = String.valueOf(weights[i]);
            if (getHeight() > MIN_HEIGHT)
            	g.drawString(temp.substring(0,3), (p[i].x + 5),p[i].y < 5 ? p[i].y + 6 : p[i].y);
            s[i] = p[i].getShape();
        }        
        g.setColor(color);
        for(int i = 0; i < items.length; i++){
            g.fill(s[i]);
        }
        g.setColor(Color.black);
        //for(int i = 0; i < items.length; i++){
        //    g.draw(s[i]);
        //}
        //Draw the Line axis
        g.drawLine(5, 0, 5, getHeight()-getBottom()); //y-axis
        g.drawLine(5, getHeight()-getBottom(), getWidth() - 5, getHeight()-getBottom()); //x-axis
        
        //Draw the static labels  
        g.setFont(font);
        if (getHeight() > MIN_HEIGHT - 5){
        	String utility_upper_bound = new String("1");
        	g.drawString(utility_upper_bound, 1, 5);
        	String utility_lower_bound = new String("0");
        	g.drawString(utility_lower_bound, 1, getHeight()-getBottom());
        }
        
        //Drawing the labels from variables passed
        //g.drawString(attributeName, 90 ,240);
        int Incre = (getWidth()-(getWidth()/4)) / (items.length-1); // This is the variable that calculate how far each point should be.
        //Labelling different utilities
    	((Graphics2D) g).setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, 
				  RenderingHints.VALUE_TEXT_ANTIALIAS_ON);  
    	if (getHeight() > MIN_HEIGHT - 8){
	        for(int i = 0; i < items.length; i++){
	            g.drawString(items[i], ((Incre * i) - items[i].length()*2) + getSpacing(i), getHeight()-1);
	        }       
    	}

    }