Setting Gradient Type to Radial

The following snippet of code:

tbl.get_Item(2, i+1).getFillFormat().setFillType(FillType.Gradient);
tbl.get_Item(2,i+1).getFillFormat().getGradientFormat().setLinearGradientScaled(GradientShape.Radial);
tbl.get_Item(2, i+1).getFillFormat().getGradientFormat().setGradientDirection(2);
tbl.get_Item(2, i+1).getFillFormat().getGradientFormat().getGradientStops().add((float)1.0, Color.YELLOW);
tbl.get_Item(2, i+1).getFillFormat().getGradientFormat().getGradientStops().add((float)0, Color.RED);

still produces a linear gradient type instead of radial. Is there something I’m missing?

Never mind. Just had to add

tbl.get_Item(2, i+1).getFillFormat().getGradientFormat().setGradientShape(GradientShape.Radial);

@ashwin.sundaram

I have shared a piece of code in text file with you. This will help you to achieve your requirements. Please share feedback with us if there is still an issue.

Best Regards,

Adnan Ahmadcode.zip (317 Bytes)