<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
/**
 * @deprecated dashboard graphs were migrated to dynamic chart.js solution
 * @see Magento_Backend::dashboard/chart.phtml
 * @phpcs:ignoreFile
 */
?>
<div class="dashboard-diagram">
    <div class="dashboard-diagram-switcher">
        <label for="order_<?= $block->getHtmlId() ?>_period"
               class="label"><?= $block->escapeHtml(__('Select Range:')) ?></label>
        <select name="period" id="order_<?= $block->getHtmlId() ?>_period"
                onchange="changeDiagramsPeriod(this);" class="admin__control-select">
            <?php //phpcs:disable ?>
            <?php foreach ($this->helper(\Magento\Backend\Helper\Dashboard\Data::class)->getDatePeriods() as $value => $label) : ?>
                <?php
                //phpcs:enable
                if (in_array($value, ['custom'])) {
                    continue;
                } ?>
                <option value="<?= /* @noEscape */ $value ?>"
                    <?php if ($block->getRequest()->getParam('period') == $value) : ?> selected="selected"<?php endif; ?>
                    ><?= $block->escapeHtml($label) ?></option>
            <?php endforeach; ?>
        </select>
    </div>
    <?php if ($block->getCount()) : ?>
    <div class="dashboard-diagram-image">
        <img src="<?= $block->escapeUrl($block->getChartUrl(false)) ?>" class="dashboard-diagram-chart" alt="Chart" title="Chart" />
    </div>
    <?php else : ?>
    <div class="dashboard-diagram-nodata">
        <span><?= $block->escapeHtml(__('No Data Found')) ?></span>
    </div>
    <?php endif; ?>
</div>
