The correct chemical formula for the ionic compound magnesium chlorate, considering that magnesium has a +2 charge and chlorate (ClO3) has a -1 charge, is:
Mg(ClO3)2
This is because you need two chlorate ions to balance the +2 charge from one magnesium ion.