@staticmethod
    def seriesChartDownload(r, **attr):

        from gluon.contenttype import contenttype

        filename = "%s_chart.png" % r.record.name

        response = current.response
        response.headers["Content-Type"] = contenttype(".png")
        response.headers["Content-disposition"] = "attachment; filename=\"%s\"" % filename

        chart_file = S3SurveySeriesModel.getChartName()
        cached = S3Chart.getCachedFile(chart_file)
        if cached:
            return cached

        # The cached version doesn't exist so regenerate it
        output = {}
        get_vars = current.request.get_vars
        if "labelQuestion" in get_vars:
            label_question = get_vars.labelQuestion
        if "numericQuestion" in get_vars:
            numeric_question_list = get_vars.numericQuestion
            if not isinstance(numeric_question_list, (list, tuple)):
                numeric_question_list = [numeric_question_list]
        if (numeric_question_list != None) and (label_question != None):
            S3SurveySeriesModel.drawChart(output, r.id, numeric_question_list,
                                          label_question, outputFormat="png")
        return output["chart"]

    # -------------------------------------------------------------------------
parse the given iso8601 duration string into a python timedelta object
dataset/ETHPy150Open sahana/eden/modules/s3db/survey.py/S3SurveySeriesModel.seriesChartDownload--crossover with--dataset/ETHPy150Open fictivekin/openrecipes/scrapy_proj/openrecipes/util.py/parse_isoduration