Here's what the guidebook says...
You can save Pikmin from each of the monster's attacks, except for electricity; yellow Pikmin are indispensable in the final battle because of their electricity resistance and their ability to fly high. As the battle begins, face the beast with a band of yellows and keep the other troops safe.
Monster Pump. Destroy the water cannon first-its water blasts reach farther than any other attacks. Toss yellows at the cannon, but prepare to call them if they get into trouble. Check your remote group during blasts to ensure that your other Pikmin are unharmed.
Shock Therapist. Because electric attacks are devastating to all except yellows, you'll want to attack the creature's electric zapper immediately after you take out the water cannon. Toss Pikmin up to the charged implement and keep fighting until it's gone.
Flare Cannon. Once the boss can't hit your Pikmin with water or electricity, it'll be relatively safe to put non-yellow Pikmin on the offensive. Use reds to attack the monster's fire blaster.
Comedy Bomb. If your white Pikmin are up to the task, have them attack the boss's final part. If you're low on white Pikmin, use other types, but be ready to save them from the poisonous clouds.
The Disarmed Dweevil. After you strip the creature of its weapons, you'll be able to beat it with a squad of purple Pikmin. Attack, call the troops after the Dweevil shakes, then attack again.
Hope this helps. I myself used only yellows until the end, but feel free to do whatever you want to.