Actually, for me, I've found that it can be lack of calcium, magnesium or potassioum that causes me to have muscle cramps or "charley horses."
Some leg/knee/calf pain is due to the shoes we wear. I, personally, have a lot less leg pain since I started wearing MBT's (and, no, I'm not affiliated with the company in any way nor do I get any financial benefit from telling people about this). MBT is short for "Masai Barefoot Technology."