Indeed, it's probably not due to marijuana legalisation, unless the resulting decline had a four year lag period for some reason, which I won't attempt to argue.
Iād be more surprised if the effect was immediate. Addiction takes years to develop, and years to recover from. I would also expect marijuana legalization to have more impact on (potential) future drug users than people already addicted to opioids.