{% load taskmonitor %}

{% random_id as data_id %}

<figure class="highcharts-figure">
    {% include "admin/taskmonitor/report/div_chart_partial.html" with data_id=data_id %}
    <script>
        fetch("{% url 'taskmonitor:admin_taskmonitor_report_json' report_name %}")
            .then((response) => response.json())
            .then((data) => {
                Highcharts.chart('{{ data_id }}-container', {
                    chart: {
                        type: 'column',
                    },
                    credits: {
                        enabled: false
                    },
                    title: null,
                    plotOptions: {
                        bar: {
                            stacking: 'normal',
                            dataLabels: {
                                enabled: true
                            }
                        }
                    },
                    xAxis: {
                        type: 'datetime',
                    },
                    yAxis: {
                        title: false
                    },
                    series: data.data,
                    });
            });
    </script>
</figure>
