D3 reusable chart example (axis, transition, event callback)