<?php
/**
 * @package            Joomla
 * @subpackage         Documents Seller
 * @author             Tuan Pham Ngoc
 * @copyright          Copyright (C) 2010 - 2025 Ossolution Team
 * @license            GNU/GPL, see LICENSE.php
 */

defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;

HTMLHelper::_('jquery.framework');
HTMLHelper::_('behavior.core');
$this->sales = (array)$this->sales;
$rootUri  = Uri::root();
EdocmanHelper::addScript($rootUri . 'administrator/components/com_edocman/assets/js/chartjs/Chart.min.js');
EdocmanHelper::addScript($rootUri . 'administrator/components/com_edocman/assets/js/chartjs/chartjs-plugin-datalabels.min.js');
EdocmanHelper::addScript($rootUri . 'administrator/components/com_edocman/assets/js/admin-chart-default.js');
Factory::getApplication()->getDocument()
	->addScriptOptions('labels', array_keys($this->sales))
	->addScriptOptions('sales', array_values($this->sales))
?>
<form action="index.php?option=com_edocman&view=chart" method="post" name="adminForm" id="adminForm">
    <div class="dms-chart-document-filter-container span2">
        <?php echo $this->lists['filter_category_id']; ?>
    </div>
<canvas id="dms-sales-chart"></canvas>
<input type="hidden" name="task" id="task" value="" />	
<?php echo HTMLHelper::_('form.token'); ?>
</form>

