build BarChart categories array dynamically