'Create a chart object.
Args:
options: The chart type and subtype options.
Returns:
Reference to a Chart object.'

def add_chart(self, options):

    chart_type = options.get('type')
    if (chart_type is None):
        warn('Chart    type    must    be    defined    in    add_chart()')
        return
    if (chart_type == 'area'):
        chart = ChartArea(options)
    elif (chart_type == 'bar'):
        chart = ChartBar(options)
    elif (chart_type == 'column'):
        chart = ChartColumn(options)
    elif (chart_type == 'doughnut'):
        chart = ChartDoughnut(options)
    elif (chart_type == 'line'):
        chart = ChartLine(options)
    elif (chart_type == 'pie'):
        chart = ChartPie(options)
    elif (chart_type == 'radar'):
        chart = ChartRadar(options)
    elif (chart_type == 'scatter'):
        chart = ChartScatter(options)
    elif (chart_type == 'stock'):
        chart = ChartStock(options)
    else:
        warn(("Unknown    chart    type    '%s'    in    add_chart()" % chart_type))
        return
    if ('name' in options):
        chart.chart_name = options['name']
    chart.embedded = True
    chart.date_1904 = self.date_1904
    chart.remove_timezone = self.remove_timezone
    self.charts.append(chart)
    return chart
