I presume u make Top and bottor selection through the help of a button or text oblejct. Uwould need to use variables in this case. u should set action in the text object to set variables and use these variales in show condition of the chart.
How have u set the "top" and "bottom" selection for user?
if u r plaing to have it in the back end as u have already dont, then u will have to set always ne selected in the field Sornname or sortno, then add another row as default to it. use the filed in a lsit box to let user select and add condition like
if(getfieldselections(Sornname)='Top N',1,0) ----------- for top n chart
if(getfieldselections(Sornname)='Bottom N',1,0) ----------- for bottom n chart
if(getfieldselections(Sornname)='Default',1,0) ----------- for Defaukt chart