Chocolate is made from a cocoa bean. What keeps that bean from being considered kitniyos?
There were briefly those who'd heard of this thing called coffee -- it's a "bean", you grind it -- who wondered if it were kitniyot.
This was quickly rejected, I don't recall who it was who'd said "if you ever saw a coffee plant, you'd understand why it's not kitniyos."
Very simply -- all kitniyos, like the 5 grains, are annuals. Coffee and chocolate are perennials.
Just because the English word is 'bean' does not mean that it is kitniyos. A good explanation can be found at What is Kitniyot?
Here is the initial summary of that article. You can read the details there.
Authored by the Orthodox Union. Copyright © 2008 Orthodox Union
In addition to the Torah’s restrictions on owning, eating and benefiting from chametz, an Ashkenazic minhag developed in the middle ages to not eat certain foods known collectively as “kitnios”. The Mishnah Berurah (453:6 & 464:5) cites three reasons for the minhag (a) kitnios is harvested and processed in the same manner as chametz, (b) it is ground into flour and baked just like chametz [so people may mistakenly believe that if they can eat kitnios, they can also eat chametz], (c) it may have chametz grains mixed into it [so people who eat kitnios may inadvertently be eating chametz]. Although initially there were those who objected to the minhag, it has become an accepted part of Pesach in all Ashkenazic communities.