How would I visualize this a linegraph? I tried to use the time series, but it either keeps complaining it cannot find a time field. And when I query the year field as “time”, it still doesn’t work.
In general (but not exclusively), the datasources which Grafana offers the most benefits are time series databases, like Prometheus, InfluxDB, etc. as well as regular relational databases (MySQL, etc.). Grafana can also work with simpler datasources like .csv files or Google Sheets. Many of the panels / visualizations in Grafana expect there to be a “time” field, which is the basis for the complaining message that you observed.
Depending on your datasource, the “time” field will need to be named (or renamed) appropriately for Grafana to understand what is your time field.