A PHP helper for d3 charts