{% if chartData is defined and chartType is defined %}
    {% if chartData.data is defined %}
        {% set chartData = chartData.data %}
    {% endif %}

    {% if 'table' == chartType %}
        {{ include('@MauticCore/Helper/table.html.twig', {
            'headItems': (chartData[0] is defined) ? chartData[0]|keys : [],
            'bodyItems': chartData,
        }) }}
    {% else %}
        {{ include('@MauticCore/Helper/chart.html.twig', {'chartData': chartData, 'chartType': chartType, 'chartHeight': chartHeight}) }}
    {% endif %}

    {% if dateFrom is iterable %}
        {# Using cached data #}
        {% set dateFrom = dateToFullConcat(dateFrom.date, dateFrom.timezone) %}
        {% set dateTo = dateToFullConcat(dateTo.date, dateTo.timezone) %}
    {% endif %}
    <div class="pull-right mr-md mb-md">
        <a href="{{ path('mautic_report_action', {'objectId': reportId, 'objectAction': 'view', 'daterange': {'date_to': dateTo, 'date_from': dateFrom}}) }}">
            <span class="label label-success">{{ 'mautic.report.dashboard.widgets.full_report'|trans }}</span>
        </a>
    </div>
    <div class="clearfix"></div>
{% else %}
    <div class="ml-20 mr-20 mt-lg px-2 alert alert-danger" role="alert">
        <a href="#" class="alert-link"><i class="ri-alert-line" aria-hidden="true"></i> {{ 'mautic.report.dashboard.widgets.no_report_found'|trans|purify }}</a>
    </div>
    <div class="clearfix"></div>
{% endif %}
