one way of doing it could be as follows:
building a Master Wind Direction table to which you connect your wind variable.
Create it in your script by doing something like the following:
load distinct WindDirection // thislinks to your table with production and wind dircetion
put your class function here as WindDirectionGroup // this creates your 12 groups you want on the radar chart
now you attach to the previos table a 12 row table which gives you the sorting you are looking for
This table would have its 12 rows as you achieved with using your class function, make sure the WindDirectionGroup has the sames names and they will link up
load * inline
330 t 360, 1
0 to 30, 2
Now in your radar chart use the WindDirectionGroup field as dimension, sum the production from your initial table, on the sort tab select "Expression" and then select the WindDirectionGroupSortOrder in th expression box, on the presentation tab make sure "Supress ZERo-values" and " suppress missing" are not ticked.
hope this helps
I know your requirement is to produce a radar chart but I think the intention behind the chart is to compare production at the different points on the compas. I agree that it is logical to display it as a radar but I can't help but feel that a bar chart would be better to compare the quantity at each direction.
Realizing what effect you are trying to achieve I have to wonder what would happen to your radar chart if the user were to filter out directions greater than 180, the radar chart would still display a circle but you'd have only half a circle worth of compass points.
Just some things to think about from a vizualization perspective.