<script>
// Create a new YUI instance and populate it with the required modules.
YUI().use('charts', function (Y) {
    var datasets = {{ chart.get_data_json|safe }};

    {% block yui_chart_type %}
        // Instantiate and render the chart
        var mychart = new Y.Chart({
            dataProvider: datasets,
            render: "#{{ chart.get_html_id }}",
            type: "{{chart.get_chart_type}}",
            categoryKey:"{{ chart.get_category_key }}",
            styles: {{ chart.get_options_json|safe }}
        });
    {% endblock %}
});
</script>
