diff --git a/module/bug/control.php b/module/bug/control.php index e3b53f0933..cbf9ff90ed 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -178,7 +178,6 @@ class bug extends control { $this->loadModel('report'); $this->view->charts = array(); - $this->view->renderJS = ''; if(!empty($_POST)) { @@ -189,11 +188,9 @@ class bug extends control $chartOption = $this->lang->bug->report->$chart; $this->bug->mergeChartOption($chart); - $chartXML = $this->report->createSingleXML($chartData, $chartOption->graph); - $this->view->charts[$chart] = $this->report->createJSChart($chartOption->swf, $chartXML, $chartOption->width, $chartOption->height); + $this->view->charts[$chart] = $chartOption; $this->view->datas[$chart] = $this->report->computePercent($chartData); } - $this->view->renderJS = $this->report->renderJsCharts(count($this->view->charts)); } $this->bug->setMenu($this->products, $productID); diff --git a/module/bug/js/report.js b/module/bug/js/report.js index e69de29bb2..eb436d6e5a 100644 --- a/module/bug/js/report.js +++ b/module/bug/js/report.js @@ -0,0 +1,13 @@ +$(function() +{ + var resizeChartTable = function() + { + $('.table-wrapper').each(function() + { + var $this = $(this); + $this.css('max-height', $this.closest('.table').find('.chart-wrapper').outerHeight()); + }); + }; + resizeChartTable(); + $(window).resize(resizeChartTable); +}); diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 24d948fd2e..5e96ca36a2 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -283,18 +283,9 @@ $lang->bug->report->charts['bugsPerAssignedTo'] = 'AssignedTo'; $lang->bug->report->options = new stdclass(); $lang->bug->report->options->graph = new stdclass(); -$lang->bug->report->options->swf = 'pie2d'; -$lang->bug->report->options->width = 'auto'; -$lang->bug->report->options->height = 300; -$lang->bug->report->options->graph->baseFontSize = 12; -$lang->bug->report->options->graph->showNames = 1; -$lang->bug->report->options->graph->formatNumber = 1; -$lang->bug->report->options->graph->decimalPrecision = 0; -$lang->bug->report->options->graph->animation = 0; -$lang->bug->report->options->graph->rotateNames = 0; -$lang->bug->report->options->graph->yAxisName = 'COUNT'; -$lang->bug->report->options->graph->pieRadius = 100; -$lang->bug->report->options->graph->showColumnShadow = 0; +$lang->bug->report->options->type = 'pie'; +$lang->bug->report->options->width = 500; +$lang->bug->report->options->height = 140; $lang->bug->report->bugsPerProject = new stdclass(); $lang->bug->report->bugsPerBuild = new stdclass(); @@ -336,20 +327,14 @@ $lang->bug->report->bugsPerProject->graph->xAxisName = 'Project'; $lang->bug->report->bugsPerBuild->graph->xAxisName = 'Build'; $lang->bug->report->bugsPerModule->graph->xAxisName = 'Module'; -$lang->bug->report->openedBugsPerDay->swf = 'column2d'; -$lang->bug->report->openedBugsPerDay->height = 400; +$lang->bug->report->openedBugsPerDay->type = 'bar'; $lang->bug->report->openedBugsPerDay->graph->xAxisName = 'Date'; -$lang->bug->report->openedBugsPerDay->graph->rotateNames = 1; -$lang->bug->report->resolvedBugsPerDay->swf = 'column2d'; -$lang->bug->report->resolvedBugsPerDay->height = 400; +$lang->bug->report->resolvedBugsPerDay->type = 'bar'; $lang->bug->report->resolvedBugsPerDay->graph->xAxisName = 'Date'; -$lang->bug->report->resolvedBugsPerDay->graph->rotateNames = 1; -$lang->bug->report->closedBugsPerDay->swf = 'column2d'; -$lang->bug->report->closedBugsPerDay->height = 400; +$lang->bug->report->closedBugsPerDay->type = 'bar'; $lang->bug->report->closedBugsPerDay->graph->xAxisName = 'Date'; -$lang->bug->report->closedBugsPerDay->graph->rotateNames = 1; $lang->bug->report->openedBugsPerUser->graph->xAxisName = 'User'; $lang->bug->report->resolvedBugsPerUser->graph->xAxisName= 'User'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index 668af63f0f..ad1c750f12 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -282,19 +282,10 @@ $lang->bug->report->charts['bugsPerAssignedTo'] = '指派给统计'; //$lang->bug->report->charts['bugHistories'] = 'Bug处理步骤统计'; $lang->bug->report->options = new stdclass(); -$lang->bug->report->options->graph = new stdclass(); -$lang->bug->report->options->swf = 'pie2d'; -$lang->bug->report->options->width = 'auto'; -$lang->bug->report->options->height = 300; -$lang->bug->report->options->graph->baseFontSize = 12; -$lang->bug->report->options->graph->showNames = 1; -$lang->bug->report->options->graph->formatNumber = 1; -$lang->bug->report->options->graph->decimalPrecision = 0; -$lang->bug->report->options->graph->animation = 0; -$lang->bug->report->options->graph->rotateNames = 0; -$lang->bug->report->options->graph->yAxisName = 'COUNT'; -$lang->bug->report->options->graph->pieRadius = 100; // 饼图直径。 -$lang->bug->report->options->graph->showColumnShadow = 0; // 是否显示柱状图阴影。 +$lang->bug->report->options->graph = new stdclass(); +$lang->bug->report->options->type = 'pie'; +$lang->bug->report->options->width = 500; +$lang->bug->report->options->height = 140; $lang->bug->report->bugsPerProject = new stdclass(); $lang->bug->report->bugsPerBuild = new stdclass(); @@ -336,20 +327,14 @@ $lang->bug->report->bugsPerProject->graph->xAxisName = '项目'; $lang->bug->report->bugsPerBuild->graph->xAxisName = '版本'; $lang->bug->report->bugsPerModule->graph->xAxisName = '模块'; -$lang->bug->report->openedBugsPerDay->swf = 'column2d'; -$lang->bug->report->openedBugsPerDay->height = 400; +$lang->bug->report->openedBugsPerDay->type = 'bar'; $lang->bug->report->openedBugsPerDay->graph->xAxisName = '日期'; -$lang->bug->report->openedBugsPerDay->graph->rotateNames = 1; -$lang->bug->report->resolvedBugsPerDay->swf = 'column2d'; -$lang->bug->report->resolvedBugsPerDay->height = 400; +$lang->bug->report->resolvedBugsPerDay->type = 'bar'; $lang->bug->report->resolvedBugsPerDay->graph->xAxisName = '日期'; -$lang->bug->report->resolvedBugsPerDay->graph->rotateNames = 1; -$lang->bug->report->closedBugsPerDay->swf = 'column2d'; -$lang->bug->report->closedBugsPerDay->height = 400; +$lang->bug->report->closedBugsPerDay->type = 'bar'; $lang->bug->report->closedBugsPerDay->graph->xAxisName = '日期'; -$lang->bug->report->closedBugsPerDay->graph->rotateNames = 1; $lang->bug->report->openedBugsPerUser->graph->xAxisName = '用户'; $lang->bug->report->resolvedBugsPerUser->graph->xAxisName= '用户'; diff --git a/module/bug/model.php b/module/bug/model.php index 20e587fbc3..88df516bfd 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1182,7 +1182,7 @@ class bugModel extends model $commonOption = $this->lang->bug->report->options; $chartOption->graph->caption = $this->lang->bug->report->charts[$chartType]; - if(!isset($chartOption->swf)) $chartOption->swf = $commonOption->swf; + if(!isset($chartOption->type)) $chartOption->type = $commonOption->type; if(!isset($chartOption->width)) $chartOption->width = $commonOption->width; if(!isset($chartOption->height)) $chartOption->height = $commonOption->height; diff --git a/module/bug/view/report.html.php b/module/bug/view/report.html.php index 0024e5982c..fa0ceba044 100644 --- a/module/bug/view/report.html.php +++ b/module/bug/view/report.html.php @@ -11,6 +11,7 @@ */ ?> +
icons['bug']);?> @@ -43,25 +44,32 @@ bug->report->common;?>
- $chartContent):?> - - - + +
+ $chartOption):?> +
+
+
bug->report->charts[$chartType];?>
+
+
+
bug->report->$chartType, 'height', $lang->bug->report->options->height) . 'px'; ?> -
- +
+
- + + $data):?> - - + + + @@ -74,5 +82,4 @@ - diff --git a/module/story/view/report.html.php b/module/story/view/report.html.php index f3c897bf34..e3010bbeb3 100644 --- a/module/story/view/report.html.php +++ b/module/story/view/report.html.php @@ -53,7 +53,7 @@
bug->report->charts[$chartType];?>
report->item;?>report->item;?> report->value;?> report->percent;?>
name;?>value;?>name;?>value;?> percent * 100) . '%';?>
-
+
story->report->charts[$chartType];?>