summaryrefslogtreecommitdiff
path: root/app/Template/analytic/avg_time_columns.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-11-21 22:50:57 -0500
committerFrederic Guillot <fred@kanboard.net>2016-11-21 22:50:57 -0500
commit8976f4d15c151afaf2249c526c6a42463e98f491 (patch)
tree990ee2b73ad171b0d04fc199e6d20242e80da8da /app/Template/analytic/avg_time_columns.php
parenta3bb27109dc01fa5df2c771b84620f1e8f56b849 (diff)
Use components to render charts
Diffstat (limited to 'app/Template/analytic/avg_time_columns.php')
-rw-r--r--app/Template/analytic/avg_time_columns.php38
1 files changed, 19 insertions, 19 deletions
diff --git a/app/Template/analytic/avg_time_columns.php b/app/Template/analytic/avg_time_columns.php
index 91c269fc..a1690c2a 100644
--- a/app/Template/analytic/avg_time_columns.php
+++ b/app/Template/analytic/avg_time_columns.php
@@ -5,25 +5,25 @@
<?php if (empty($metrics)): ?>
<p class="alert"><?= t('Not enough data to show the graph.') ?></p>
<?php else: ?>
- <section id="analytic-avg-time-column">
+ <?= $this->app->component('chart-avg-time-column', array(
+ 'metrics' => $metrics,
+ 'label' => t('Average time spent'),
+ )) ?>
- <div id="chart" data-metrics='<?= json_encode($metrics, JSON_HEX_APOS) ?>' data-label="<?= t('Average time spent') ?>"></div>
+ <table class="table-striped">
+ <tr>
+ <th><?= t('Column') ?></th>
+ <th><?= t('Average time spent') ?></th>
+ </tr>
+ <?php foreach ($metrics as $column): ?>
+ <tr>
+ <td><?= $this->text->e($column['title']) ?></td>
+ <td><?= $this->dt->duration($column['average']) ?></td>
+ </tr>
+ <?php endforeach ?>
+ </table>
- <table class="table-striped">
- <tr>
- <th><?= t('Column') ?></th>
- <th><?= t('Average time spent') ?></th>
- </tr>
- <?php foreach ($metrics as $column): ?>
- <tr>
- <td><?= $this->text->e($column['title']) ?></td>
- <td><?= $this->dt->duration($column['average']) ?></td>
- </tr>
- <?php endforeach ?>
- </table>
-
- <p class="alert alert-info">
- <?= t('This chart show the average time spent into each column for the last %d tasks.', 1000) ?>
- </p>
- </section>
+ <p class="alert alert-info">
+ <?= t('This chart show the average time spent into each column for the last %d tasks.', 1000) ?>
+ </p>
<?php endif ?>