Forum Discussion
mojganmeibodi19
2 years agoRegular Visitor
sorting legend based on two criteria
I have a simple dataset that contains each supplier's sale in each year. I made a bar chart with years in the x axis and suppliers' sale on the y axis and used supplier company as legend. I wa...
lbendlin
Super User
2 years agoCould you layer the individual columns as separate marks with their own sort order? Or would you have to know the number of columns/marks beforehand?
dm-p
Super User
2 years agoWhatever the layer, if they share the same encoding channel, Vega will likely resolve them to the same scale (and sort). Your best bet would be to use a window transform to generate a numeric order based on grouping and sorting of multiple fields in the dataset and then sort on that.