def completed_chart():
 series_id = get_vars.get('series_id')
 if (not series_id):
  return 'Programming Error: Series ID missing'
 question_id = get_vars.get('question_id')
 if (not question_id):
  return 'Programming Error: Question ID missing'
 q_type = get_vars.get('type')
 if (not q_type):
  return 'Programming Error: Question Type missing'
 getAnswers = s3db.survey_getAllAnswersForQuestionInSeries
 answers = getAnswers(question_id, series_id)
 analysisTool = s3db.survey_analysis_type[q_type](question_id, answers)
 qstnName = analysisTool.qstnWidget.question.name
 image = analysisTool.drawChart(series_id, output='png')
 return image

def completed_chart ( ) : series_id = get_vars . get ( 'series_id' ) if ( not series_id ) : return 'Programming Error: Series ID missing' question_id = get_vars . get ( 'question_id' ) if ( not question_id ) : return 'Programming Error: Question ID missing' q_type = get_vars . get ( 'type' ) if ( not q_type ) : return 'Programming Error: Question Type missing' getAnswers = s3db . survey_getAllAnswersForQuestionInSeries answers = getAnswers ( question_id , series_id ) analysisTool = s3db . survey_analysis_type [ q_type ] ( question_id , answers ) qstnName = analysisTool . qstnWidget . question . name image = analysisTool . drawChart ( series_id , output = 'png' ) return image
allows the user to display all the data from the selected question in a simple chart .