Replace dimplejs by c3js for chart drawing

This commit is contained in:
Frederic Guillot
2015-06-21 21:12:24 -04:00
parent 1465ca1ae1
commit 81e40e2c91
36 changed files with 320 additions and 366 deletions

View File

@@ -6,7 +6,7 @@
<p class="alert"><?= t('Not enough data to show the graph.') ?></p>
<?php else: ?>
<section id="analytic-burndown">
<div id="chart" data-url="<?= $this->url->href('analytic', 'burndown', array('project_id' => $project['id'], 'from' => $values['from'], 'to' => $values['to'])) ?>"></div>
<div id="chart" data-metrics='<?= json_encode($metrics) ?>' data-date-format="<?= e('%%Y-%%m-%%d') ?>" data-label-total="<?= t('Total for all columns') ?>"></div>
</section>
<?php endif ?>

View File

@@ -3,10 +3,10 @@
</div>
<?php if (! $display_graph): ?>
<p class="alert"><?= t('Not enough data to show the graph.') ?></p>
<p class="alert"><?= t('You need at least 2 days of data to show the chart.') ?></p>
<?php else: ?>
<section id="analytic-cfd">
<div id="chart" data-url="<?= $this->url->href('analytic', 'cfd', array('project_id' => $project['id'], 'from' => $values['from'], 'to' => $values['to'])) ?>"></div>
<div id="chart" data-metrics='<?= json_encode($metrics) ?>' data-date-format="<?= e('%%Y-%%m-%%d') ?>"></div>
</section>
<?php endif ?>

View File

@@ -1,5 +1,5 @@
<?= $this->asset->js('assets/js/vendor/d3.v3.4.8.min.js') ?>
<?= $this->asset->js('assets/js/vendor/dimple.v2.1.2.min.js') ?>
<?= $this->asset->js('assets/js/vendor/d3.v3.min.js') ?>
<?= $this->asset->js('assets/js/vendor/c3.min.js') ?>
<section id="main">
<div class="page-header">

View File

@@ -7,7 +7,7 @@
<?php else: ?>
<section id="analytic-task-repartition">
<div id="chart" data-url="<?= $this->url->href('analytic', 'tasks', array('project_id' => $project['id'])) ?>"></div>
<div id="chart" data-metrics='<?= json_encode($metrics) ?>'></div>
<table>
<tr>

View File

@@ -7,7 +7,7 @@
<?php else: ?>
<section id="analytic-user-repartition">
<div id="chart" data-url="<?= $this->url->href('analytic', 'users', array('project_id' => $project['id'])) ?>"></div>
<div id="chart" data-metrics='<?= json_encode($metrics) ?>'></div>
<table>
<tr>

View File

@@ -1,5 +1,5 @@
<?= $this->asset->js('assets/js/vendor/d3.v3.4.8.min.js') ?>
<?= $this->asset->js('assets/js/vendor/dimple.v2.1.2.min.js') ?>
<?= $this->asset->js('assets/js/vendor/d3.v3.min.js') ?>
<?= $this->asset->js('assets/js/vendor/c3.min.js') ?>
<div class="page-header">
<h2><?= t('Budget overview') ?></h2>
@@ -8,7 +8,8 @@
<?php if (! empty($daily_budget)): ?>
<div id="budget-chart">
<div id="chart"
data-serie='<?= json_encode($daily_budget) ?>'
data-date-format="<?= e('%%Y-%%m-%%d') ?>"
data-metrics='<?= json_encode($daily_budget) ?>'
data-labels='<?= json_encode(array('in' => t('Budget line'), 'out' => t('Expenses'), 'left' => t('Remaining'), 'value' => t('Amount'), 'date' => t('Date'), 'type' => t('Type'))) ?>'></div>
</div>
<hr/>