Bar Graph Using Flux( Vehicle speed versus Bcmcommand modes)

I have to visualize the same graph using Grafana by writing flux query.
But the problem is i dont have this sonic,ride,dash and Eco fields.But i have bcm_modecommands column this column has values 1,2,3,4 for representing eco,sonic etc…
how to write flex query to get this above grapgh? please help me with this.
X axis:bcmcommand modes(0,1,2,3 it has values…)not having values like range,sonic,dash
Y axis: Maximun vehicle_Speed


Try to use the case statement like 1=Sonic 2=Ride etc.