In a small pot, stir sugar, cornstarch, and cocoa powder together. Whisk in milk and place over medium heat until the mixture comes to a boil and starts to thicken. Once hot and thick remove from heat and stir in chopped chocolate and vanilla. Pour into pie plate and cover with plastic wrap. Be sure to place the plastic wrap directly on the filling. Refrigerate for 2 hours or until completely chilled and the plastic wrap comes off clean.
Cut pie into 8 pieces and top with dollops of cream and chocolate shavings and serve.