@Override public void paintComponent(Graphics g2) {
			Graphics2D g = (Graphics2D) g2; // Create Graphics Object
	        super.paintComponent(g); // Paint Background

			// Get the size of the x path vectors
	        int size_of_xpath = xPath.size();

	        // Create array of integers
	        int[] xPoints = new int[size_of_xpath];
	 		int[] yPoints = new int[size_of_xpath];

	 		// Add Vector Elements to the Array
	 		for (int j = 0; j < size_of_xpath; j++)
	 		{
	 			xPoints[j] = xPath.elementAt(j);
	 			yPoints[j] = yPath.elementAt(j);
	 		}

			//create polygon
	 		Polygon poly = new Polygon(xPoints, yPoints, size_of_xpath);

	 		//move polygon to centre of JPanel
	 	    poly.translate(thickness/2, thickness/2);
	 	    if (fill==true)
	 	    {
		 	     if(fill_type<=0 || fill_type>=3)//if fill is not range
		 		{
			 		fill_type = 1;
		 		}
		 		else
		 		{
		 			if(fill_type==1)
			 		{
			 			Color fillC = new Color(fillColor);
			 			g.setPaint(fillC);//Colour main body
			 		}
			 		else if(fill_type==2)
			 		{
			 			Color grad_color1 = new Color(color1);
						Color grad_color2 = new Color(color2);
						//gradient
				 		GradientPaint fillcol = new GradientPaint(x_at_color1, y_at_color1,
				 								grad_color1, x_at_color2, y_at_color2,
				 								grad_color2, is_cyclic);
						g.setPaint(fillcol);//Gradient main body
			 		}

			 		if(alpha>=0 & alpha<=1)
			 		{
			 			g.setComposite(AlphaComposite.getInstance
			 							(AlphaComposite.SRC_OVER, (float)alpha));
			 		}
					g.fill(poly);	//create main body
		 		}
	 	    }

	 		if(thickness!=0)
	 		{
	 			Color lineC = new Color(lineColor);
	 			//set edge thickness
		 	    BasicStroke edgeThickness = new BasicStroke(thickness,
		 	    							BasicStroke.CAP_ROUND,
		 	    							BasicStroke.JOIN_ROUND);
	 			g.setStroke(edgeThickness); //set line thickness
	 			g.setPaint(lineC);			//Colour line
	 			if(alpha>=0 & alpha<=1)
	 			{
	 				g.setComposite(AlphaComposite.getInstance
	 								(AlphaComposite.SRC_OVER, (float)alpha));
	 			}
	 			g.drawPolygon(poly);	//create line round shape
	 		}
	    }