Adds option to pass margin
Adds option to pass tooltip formatting function