is failing because you are using the old event callback signature (datum, index) with D3v7, which uses the signature (event, datum). This code is passing an undefined event (d, and then you are trying to access an element it doesn’t have) into your HTML leading to the ‘undefined’ in the tooltip. It is also passing an undefined into the data-date attribute.