This function will help you to fetch the response percentage for a specific answer option of a question. You can also filter out the average response value by passing the filter in the function.
getPercentageForQuestion(questionID , answerID, filter, function(value) {
//You will get the value here, so write your code here
})
Refer to Filters for more information