Combine sugar, water, and rosemary leaves in a small saucepan. Cook over medium heat, stirring constantly, until mixture comes to a boil. Reduce heat, and simmer, uncovered, 8 minutes or until slightly thickened. Cool completely. Pour syrup through a wire mesh strainer into a cup; discard rosemary.
Peel and section oranges and grapefruit over a large bowl to catch juices. Cut pineapple into bite-sized chunks. Add pineapple and banana to orange mixture. Pour rosemary syrup over fruit; stir gently.
Pour fruit mixture into a large, shallow dish; sprinkle with coconut. Garnish with rosemary, if desired.