If we were to assume that a cocoa bean is a vegetable, then that would mean chocolate is a manufactured product with a vegetable as one of its ingredients. A product that contains vegetables does not automatically qualify as a vegetable. If we were to follow this reasoning then peanut butter would also be a vegetable--which it is not.
If one were to classify chocolate in the food pyramid it would be in the 'junk' section.