Fix CFD chart (stack wrongly ordered)

This commit is contained in:
Frederic Guillot 2017-02-11 19:42:17 -05:00
parent 2c45096411
commit c5caff7ef7
9 changed files with 53 additions and 46 deletions

View File

@ -22,6 +22,7 @@ Bug fixes:
* Search with multiple expressions with double quotes was not working
* Fix broken subtask restriction per user
* Fix CFD chart (stack wrongly ordered)
Version 1.0.38 (Jan 28, 2017)
-----------------------------

View File

@ -143,17 +143,18 @@ class AnalyticController extends BaseController
$project = $this->getProject();
list($from, $to) = $this->getDates();
$display_graph = $this->projectDailyColumnStatsModel->countDays($project['id'], $from, $to) >= 2;
$displayGraph = $this->projectDailyColumnStatsModel->countDays($project['id'], $from, $to) >= 2;
$metrics = $displayGraph ? $this->projectDailyColumnStatsModel->getAggregatedMetrics($project['id'], $from, $to, $column) : array();
$this->response->html($this->helper->layout->analytic($template, array(
'values' => array(
'values' => array(
'from' => $from,
'to' => $to,
'to' => $to,
),
'display_graph' => $display_graph,
'metrics' => $display_graph ? $this->projectDailyColumnStatsModel->getAggregatedMetrics($project['id'], $from, $to, $column) : array(),
'project' => $project,
'title' => $title,
'display_graph' => $displayGraph,
'metrics' => $metrics,
'project' => $project,
'title' => $title,
)));
}

File diff suppressed because one or more lines are too long

View File

@ -8,25 +8,24 @@ KB.component('chart-project-burndown', function (containerElement, options) {
var outputFormat = d3.time.format(options.dateFormat);
for (var i = 0; i < metrics.length; i++) {
for (var j = 0; j < metrics[i].length; j++) {
var currentValue = metrics[i][j];
if (i === 0) {
columns.push([metrics[i][j]]);
} else {
columns[j + 1].push(metrics[i][j]);
if (j > 0) {
columns.push([currentValue]);
}
} else {
if (j > 0) {
columns[j].push(currentValue);
if (columns[0][i] === undefined) {
if (typeof columns[0][i] === 'undefined') {
columns[0].push(0);
}
columns[0][i] += metrics[i][j];
}
if (j === 0) {
categories.push(outputFormat(inputFormat.parse(metrics[i][j])));
columns[0][i] += currentValue;
} else {
categories.push(outputFormat(inputFormat.parse(currentValue)));
}
}
}

View File

@ -9,21 +9,19 @@ KB.component('chart-project-cumulative-flow', function (containerElement, option
var outputFormat = d3.time.format(options.dateFormat);
for (var i = 0; i < metrics.length; i++) {
for (var j = 0; j < metrics[i].length; j++) {
var currentValue = metrics[i][j];
if (i === 0) {
columns.push([metrics[i][j]]);
if (j > 0) {
groups.push(metrics[i][j]);
groups.push(currentValue);
columns.push([currentValue]);
}
} else {
columns[j].push(metrics[i][j]);
if (j === 0) {
categories.push(outputFormat(inputFormat.parse(metrics[i][j])));
if (j > 0) {
columns[j - 1].push(currentValue);
} else {
categories.push(outputFormat(inputFormat.parse(currentValue)));
}
}
}
@ -33,9 +31,14 @@ KB.component('chart-project-cumulative-flow', function (containerElement, option
c3.generate({
data: {
columns: columns,
// Example: [["Column1", 1, 2, 3], ["Column2", 1, 2, 3]]
// Note: values are reversed to make sure the columns are stacked in the right order
columns: columns.reverse(),
type: 'area-spline',
groups: [groups]
groups: [groups],
// Note: Use specified order otherwise C3js reorder series
order: null
},
axis: {
x: {

View File

@ -1,5 +1,5 @@
Analytics
=========
Project Analytics
=================
Each project have an analytics section. Depending on how you are using Kanboard, you can see those reports:
@ -23,7 +23,9 @@ Cumulative flow diagram
![Cumulative flow diagram](screenshots/cfd.png)
- This chart shows the number of tasks cumulatively for each column over the time.
- Every day, the total number of tasks is recorded for each column.
- The legend order is the same as the stack in the chart.
- The color of each column is determined automatically.
- Every day, the number of tasks is recorded for each column.
- If you would like to exclude closed tasks, change the [global project settings](project-configuration.markdown).
Note: You need to have at least two days of data to see the graph.

View File

@ -1,10 +1,10 @@
Analytique des tâches
===================
Statistiques pour les tâches
============================
Chaque tâche possède une section analytique accessible à partir du menu à gauche dans la page des tâches
Lead et cycle time
-------------------
------------------
![Lead and cycle time](screenshots/task-lead-cycle-time.png)
@ -16,7 +16,7 @@ Lead et cycle time
Remarque : vous pouvez configurer une action pour définir automatiquement que la date de départ sera le moment où vous déplacez une tâche vers une colonne de votre choix
Temps passé dans chaque colonne
---------------------------
--------------------------------
![Temps passé dans chaque colonne](screenshots/time-into-each-column.png)

View File

@ -1,35 +1,36 @@
Analytique
=========
Statistiques pour les projets
=============================
Chaque projet dispose d'une section analytique. En fonction de la façon dont vous utilisez Kanboard, vous pourrez voir les rapports suivants :
Répartition des utilisateurs
----------------
----------------------------
![Répartition des utilisateurs](screenshots/user-repartition.png)
Ce graphique circulaire affiche le nombre de tâches assignées par utilisateur.
Distribution des tâches
-----------------
-----------------------
![Distribution des tâches](screenshots/task-distribution.png)
Ce graphique circulaire donne une vue d'ensemble du nombre de tâches ouvertes par colonne.
Diagramme de flux cumulé
-----------------------
------------------------
![Diagramme de flux cumulé](screenshots/cfd.png)
- Ce graphique affiche le nombre de tâches de façon cumulée pour chaque colonne en fonction du temps passé.
- La légende montre l'ordre de la pile.
- Chaque jour, le nombre total de tâches est enregistré pour chaque colonne.
- Si vous souhaitez exclure les tâches terminées, modifiez les [paramètres du projet global](project-configuration.markdown).
Remarque : il faut au moins deux jours de données pour que le graphique apparaisse.
Graphique d'avancement
--------------
----------------------
![Graphique d'avancement](screenshots/burndown-chart.png)
@ -40,7 +41,7 @@ Un [graphique d'avancement](http://en.wikipedia.org/wiki/Burn_down_chart) est di
- Chaque jour, la somme des estimations pour chaque colonne est calculée.
Temps moyen passé pour chaque colonne
-----------------------------------
-------------------------------------
![Temps moyen passé pour chaque colonne](screenshots/average-time-spent-into-each-column.png)
@ -50,7 +51,7 @@ Ce graphique affiche le temps moyen passé pour chaque colonne pour les 1000 der
- Le temps passé est calculé jusqu'à la fin de la tâche.
Temps moyen de Lead et Cycle
---------------------------
----------------------------
![Temps moyen passé pour chaque colonne](screenshots/average-lead-cycle-time.png)
@ -63,7 +64,7 @@ Ce graphique affiche le temps moyen de lead et cycle pour les 1000 dernières t
Ces métriques sont calculées et enregistrées chaque jour pour l'ensemble du projet.
N'oubliez pas de lancer chaque jour le calcul statistique
-------------------------------------------------------
---------------------------------------------------------
Pour générer des données analytique précises, vous devriez lancer chaque jour le cronjob **statistiques quotidiennes du projet**.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 14 KiB