I have specified sorting in vegalite api as -y as shown below:
vl.markLine().data(video_data).encode(
vl.x()
.fieldN('names') //nominal
.sort('-y'), // sort by -y
//...
vl.y()
.fieldQ('d') //quantitative
//...
When I dont have percentage values, it correctly sorts:
But when I have percentage values, it screws up sorting:
Why is this so?


The problem seems to be that the
dvalues seem to be in string format. Found answer as stated here. Converting it to vegalite api: