The following query does that for you, for questions, answers, deleted questions and answers as well as the count of created wiki's
select year(creationdate)
, sum(case when posttypeid=1 and deletiondate is null then 1 else 0 end) as Q
, sum(case when posttypeid=2 and deletiondate is null then 1 else 0 end) as A
, sum(case when posttypeid=1 and deletiondate is not null then 1 else 0 end) as [ deleted Q]
, sum(case when posttypeid=2 and deletiondate is not null then 1 else 0 end) as [deleted A]
, sum(case when posttypeid=4 and deletiondate is null then 1 else 0 end) as [tag excerpt]
, sum(case when posttypeid=5 and deletiondate is null then 1 else 0 end) as [tag wiki]
from postswithdeleted
group by year(creationdate)
Instead of using the count aggregate I use a sum aggregate and use a case statement to return either a 1 or 0 per row if that row meets certain criteria, like Posttypeid =1 to denote a Question and posttypeid=2 to denote an answer.
Once that sums are done you can simply group the results per year by using the year function over the creationdate attribute of the postswithdeleted table.
Notice how I used the table postswithdeleted to also include the deleted posts. If you're only interested in just still visible posts today you could simply use the posts table. See this database schema for more info
And as we all love pictures, here is the graph:

As 2017 is not yet complete don't be alarmed by the dramatic drop currently visible...
is:q created:2009..2009