Following approach worked for me!
set the height option in the xml such that it displays only 10/required number of results
set a token in the xml that stores the count of query results(use $job.resultCount$) when the query execution is in progress/done.
use Java Script to get the count token value using splunkJS defaultTokenModel and calculate the height to set based on the result count and then set the height on $('#bar.viz-controller') element.
... View more