def get_chart(chart_type, time_span=None, rolling_average=None, api_code=None):
resource = '<STR_LIT>' + chart_type + '<STR_LIT>'<EOL>if time_span is not None:<EOL><INDENT>resource += '<STR_LIT>' + time_span<EOL><DEDENT>if rolling_average is not None:<EOL><INDENT>resource += '<STR_LIT>' + rolling_average<EOL><DEDENT>if api_code is not None:<EOL><INDENT>resource += '<STR_LIT>' + api_code<EOL><DEDENT>response = util.call_api(resource)<EOL>json_response = json.loads(response)<EOL>return Chart(json_response)<EOL>
Get chart data of a specific chart type.

    :param str chart_type: type of chart
    :param str time_span: duration of the chart.
    Default is 1 year for most charts, 1 week for mempool charts (optional)
    (Example: 5weeks)
    :param str rolling_average: duration over which the data should be averaged (optional)
    :param str api_code: Blockchain.info API code (optional)
    :return: an instance of :class:`Chart` class