Hi Anil,
Firstly, if your requirement is to retrieve only a certain number of rows, rather than restricting based on dimension members, you will definitely need to do this in the back-end via the BEx Query because you cannot manipulate the data client-side and update the crosstab/chart via scripting. If your requirement is the latter, you can restrict the result set using the setFilter() method on the data source via scripting.
To return only the first N rows of data from BEx, you would need to define a Key Figure that a sort order could be based on and then apply a Top N condition on that Key Figure.
If you can provide a more specific example of your data set rather than the generic one, we could provide further guidance.
Regards,
Mustafa.