The easier poster is correct, your reactions to the pineapple are from an electrolyte imbalance because of using Iodine during a fast.
Pineapple provides potassium and citric acid , with a minor portion of magnesium,
But Iodine triggers some cellular processes that stumble and falter without adequate magnesium, and the heartbeat, tightchestedness, slight panic and weakness is related to that. Iodine breaks down cells which are malfunctioning (triggers apoptosis), and in a fasting state you are not adequately prepared for making that many new cells.
For the proper use of iodine during fasting, soak yourself in sea water.
If you are close enough to the ocean, go and soak so your body can re-establish it's salt (electrolyte) balances.
If you feel strong enough after that, you may choose to resume your fast.
If you are not next to the ocean but have classic resources at hand, you may try this sort of mix:
Sodium borate (borax, mule team borax), 1 part
Magnesium chloride 4 parts
Sea salt from the grocery store, 5 parts
Epsom Salts (magnesium sulfate) do not provide as much magnesium as magnesium chloride, but do help to a degree.
Iodine retirement can also induce a bit of hyperactivity in the brain, and disrupt sleep because it changes the throid-kidney hormonal balances. In part, the kidney's adrenal glands release more adrenaline in response to the iodine to let you know you need amino acids and more salts and B-vitamins to create thyroid hormone from the iodine.
Approach your iodine experimentation with caution, as with any adrenaline-altering substance (indeed, like St. John's wort and certain drugs) can be habit-forming. Seawater, on the other hand, and iodine-rich foods and herbs (like Black-Walnut hull,) generally won't imbalance you.
Sodium bicarbonate is also an electrolyte, but not in the right family (molecular weight and structure) to stop the heart flimmers you experienced. Iodine foods in general like dullce, bladderwack and other kelps naturally keep the right electrolyte balance, because of living and functioning in seawater. The only caveat too them is buying them from a supplier who harvests from kelp beds not downstream from industrial plants.