
<script>
    require.config({
        paths: {
            'echarts': '{{ echarts_js_path.replace('.js', '') }}'{% if use_echarts_gl %}, 'echarts-gl': '{{ echarts_gl_js_path.replace('.js', '') }}'{% endif %}{% if use_echarts_wordcloud %}, 'echarts-wordcloud': '{{ echarts_wordcloud_js_path.replace('.js', '') }}'{% endif %}{% if map_url %}, '{{ map_name }}': '{{ map_url.replace('.js', '') }}'{% endif %}
        }
    });
</script>

    <div id="{{ chart_id }}" style="width:{{ width }}; height:{{ height }};"></div>

<script>
        require([
            'echarts'{% if use_echarts_gl %}, 'echarts-gl'{% endif %}{% if use_echarts_wordcloud %}, 'echarts-wordcloud'{% endif %}{% if map_url %}, '{{ map_name }}'{% endif %}
        ], function(echarts) {
                var chart_{{ chart_id }} = echarts.init(
                    document.getElementById('{{ chart_id }}'), '{{ theme }}', {renderer: '{{ renderer }}', locale: 'ZH'});
                var option_{{ chart_id }} = {{ option|tojson }};
                chart_{{ chart_id }}.setOption(option_{{ chart_id }});
        });
    </script>
