Cocos Creator 3 drawing with graphics does not display

I am using Cocos Creator 3.

I add cc.Graphics component to a node. This node is in UI_2D layer.

got reference to the component by


Then I try following code to draw a rectangle. = 2;[0].x, arrPoints[0].y);[1].x, arrPoints[1].y);[2].x, arrPoints[2].y);[3].x, arrPoints[3].y);; = Color.WHITE;;

But it does not draw anything. What am I doing wrong here ?