Commit d76b069d authored by Jerome Mariette's avatar Jerome Mariette
Browse files

evolution for project ok

parent 858179b0
...@@ -264,17 +264,17 @@ class tx_nG6_db { ...@@ -264,17 +264,17 @@ class tx_nG6_db {
$where .= " fe_rights.right_id=1" ; $where .= " fe_rights.right_id=1" ;
} }
$queryParts = array( $queryParts = array(
'SELECT' => 'tx_nG6_projects.timestamp, count(tx_nG6_projects.timestamp) nb', 'SELECT' => 'tx_nG6_project.crdate, count(tx_nG6_project.crdate) nb',
'FROM' => $from, 'FROM' => $from,
'WHERE' => $where, 'WHERE' => $where,
'GROUPBY' => 'tx_nG6_projects.timestamp', 'GROUPBY' => 'tx_nG6_project.crdate',
'ORDERBY' => '', 'ORDERBY' => 'tx_nG6_project.crdate',
'LIMIT' => '' 'LIMIT' => ''
); );
$results = array(); $results = array();
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$results[] = array($res_row["tx_nG6_projects.timestamp"], $res_row["nb"]); $results[] = array($res_row["crdate"], $res_row["nb"]);
} }
return $results; return $results;
......
...@@ -63,6 +63,7 @@ class tx_nG6_pi6 extends tslib_pibase { ...@@ -63,6 +63,7 @@ class tx_nG6_pi6 extends tslib_pibase {
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/bootstrap.min.js"></script> <script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/bootstrap.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/tx_nG6_pi6.js"></script> <script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/tx_nG6_pi6.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/highstock.js"></script> <script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/highstock.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.highcharts.exporting.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.dataTables.min.js"></script> <script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/DT_bootstrap.js"></script> <script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/DT_bootstrap.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.validate.js"></script> <script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.validate.js"></script>
......
...@@ -252,9 +252,28 @@ function projectEvolutionHandler() { ...@@ -252,9 +252,28 @@ function projectEvolutionHandler() {
success: function(val, status, xhr) { success: function(val, status, xhr) {
// reformat the data with values to integer // reformat the data with values to integer
for (var i=0; i <val.length; i++ ) { for (var i=0; i <val.length; i++ ) {
val[i][0] = parseInt(val[i][0])*1000;
val[i][1] = parseInt(val[i][1]); val[i][1] = parseInt(val[i][1]);
} }
console.log(val); console.log(val)
chart = new Highcharts.StockChart({
chart: {
renderTo: 'highcharts_graph'
},
rangeSelector: {
selected: 4
},
yAxis: {
min: 0,
plotLines: [{
value: 0,
width: 2,
color: 'silver'
}]
},
credits: { enabled: false },
series: [{name: "number of project", data: val}]
});
} }
}); });
} }
...@@ -330,6 +349,7 @@ function updateButtons () { ...@@ -330,6 +349,7 @@ function updateButtons () {
$(this).tooltip({container: 'body'}); $(this).tooltip({container: 'body'});
$(this).addClass("disabled").attr("rel", "tooltip"); $(this).addClass("disabled").attr("rel", "tooltip");
$("#project_distribution").unbind("click", projectDistributionHandler); $("#project_distribution").unbind("click", projectDistributionHandler);
$("#project_evolution").unbind("click", projectEvolutionHandler);
} else { } else {
// Enable // Enable
$(this).removeClass("disabled").attr("rel", null); $(this).removeClass("disabled").attr("rel", null);
...@@ -338,6 +358,7 @@ function updateButtons () { ...@@ -338,6 +358,7 @@ function updateButtons () {
$(this).removeAttr('data-title'); $(this).removeAttr('data-title');
$(this).tooltip('destroy'); $(this).tooltip('destroy');
$("#project_distribution").bind("click", projectDistributionHandler); $("#project_distribution").bind("click", projectDistributionHandler);
$("#project_evolution").bind("click", projectEvolutionHandler);
} }
}); });
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment