Around 7.5% of the graphs at Basque Wikipedia are loading https://eu.wikipedia.org/wiki/Txantiloi:Biztanleria_grafiko_automatikoa, which used the graph extension to load population data from Wikidata.
The only approach we have now is an experimental way to load data from Wikidata creating one chart definition per populated place, which would require the creation of around 4 million charts and other 4 million data tabs at commons, instead of just having one template.
The template loads Graph:Lines (https://eu.wikipedia.org/wiki/Txantiloi:Graph:Lines), a very simple graph, but could also load columns. Whatever it loads, it should be able to handle Wikidata data automatically.