Build a rule-based NL2VIS translator to understand what such systems must decide. Input: schema field:T|N|O|Q …, then one question per line (lower-case it).
Rules: the measures are quantitative fields mentioned in the question (whole words), the groups are mentioned non-quantitative fields (in schema order). The aggregate is the first keyword found in the order: average/mean → mean, total/sum → sum, "number of"/count → count, maximum/max → max, minimum → min, median → median; default mean. If there is no measure and the aggregate is not count, print CLARIFY: which quantity? (one of pm25, temperature); if there is no group, CLARIFY: by which attribute? (one of date, district). Otherwise x = first group; mark = line if x is temporal or the question contains "trend" or "over", else bar; y = count() or agg(measure); colour = second group if any. A question ending with for WORD (WORD not a field) filters the first nominal field to WORD in title case.
Build the chart with Altair and print Q: <question> and bar: x=district:N, y=mean(pm25):Q (channels sorted, aggregates written agg(field) or count(), type initial), with | filter (datum['district'] === 'Lucheng') when filtered.