diff --git a/module/common/view/chart.html.php b/module/common/view/chart.html.php index d32ba2a614..81c379babb 100644 --- a/module/common/view/chart.html.php +++ b/module/common/view/chart.html.php @@ -48,6 +48,8 @@ if($config->debug) data.push({label: $row.find('.chart-label').text(), value: parseInt($row.find('.chart-value').text()), color: color, id: idx}); }); + if(data.length > 4) options.scaleLabelPlacement = 'outside'; + chart = $canvas.pieChart(data, options); $canvas.on('mousemove', function(e) { diff --git a/module/story/control.php b/module/story/control.php index afcca12bae..94f31544e8 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1085,7 +1085,6 @@ class story extends control { $this->loadModel('report'); $this->view->charts = array(); - $this->view->renderJS = ''; if(!empty($_POST)) { @@ -1096,11 +1095,10 @@ class story extends control $chartOption = $this->lang->story->report->$chart; $this->story->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->products = $this->product->getPairs(); $this->product->setMenu($this->products, $productID); diff --git a/module/story/js/report.js b/module/story/js/report.js index e69de29bb2..eb436d6e5a 100644 --- a/module/story/js/report.js +++ b/module/story/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/story/lang/en.php b/module/story/lang/en.php index dcec7103c9..f7eb70c625 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -217,19 +217,10 @@ $lang->story->report->charts['storysPerClosedReason'] = 'Storys for reason'; $lang->story->report->charts['storysPerChange'] = 'Story version'; $lang->story->report->options = new stdclass(); -$lang->story->report->options->graph = new stdclass(); -$lang->story->report->options->swf = 'pie2d'; -$lang->story->report->options->width = 'auto'; -$lang->story->report->options->height = 300; -$lang->story->report->options->graph->baseFontSize = 12; -$lang->story->report->options->graph->showNames = 1; -$lang->story->report->options->graph->formatNumber = 1; -$lang->story->report->options->graph->decimalPrecision = 0; -$lang->story->report->options->graph->animation = 0; -$lang->story->report->options->graph->rotateNames = 0; -$lang->story->report->options->graph->yAxisName = 'COUNT'; -$lang->story->report->options->graph->pieRadius = 100; -$lang->story->report->options->graph->showColumnShadow = 0; +$lang->story->report->options->graph = new stdclass(); +$lang->story->report->options->type = 'pie'; +$lang->story->report->options->width = 500; +$lang->story->report->options->height = 140; $lang->story->report->storysPerProduct = new stdclass(); $lang->story->report->storysPerModule = new stdclass(); diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 135399d120..b642680926 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -217,21 +217,12 @@ $lang->story->report->charts['storysPerClosedReason'] = '关闭原因来进行 $lang->story->report->charts['storysPerChange'] = '变更次数来进行统计'; $lang->story->report->options = new stdclass(); -$lang->story->report->options->graph = new stdclass(); -$lang->story->report->options->swf = 'pie2d'; -$lang->story->report->options->width = 'auto'; -$lang->story->report->options->height = 300; -$lang->story->report->options->graph->baseFontSize = 12; -$lang->story->report->options->graph->showNames = 1; -$lang->story->report->options->graph->formatNumber = 1; -$lang->story->report->options->graph->decimalPrecision = 0; -$lang->story->report->options->graph->animation = 0; -$lang->story->report->options->graph->rotateNames = 0; -$lang->story->report->options->graph->yAxisName = 'COUNT'; -$lang->story->report->options->graph->pieRadius = 100; // 饼图直径。 -$lang->story->report->options->graph->showColumnShadow = 0; // 是否显示柱状图阴影。 +$lang->story->report->options->graph = new stdclass(); +$lang->story->report->options->type = 'pie'; +$lang->story->report->options->width = 500; +$lang->story->report->options->height = 140; -$lang->story->report->storysPerProduct = new stdclass(); +$lang->story->report->storysPerProduct = new stdclass(); $lang->story->report->storysPerModule = new stdclass(); $lang->story->report->storysPerSource = new stdclass(); $lang->story->report->storysPerPlan = new stdclass(); @@ -257,7 +248,7 @@ $lang->story->report->storysPerClosedReason->item = '原因'; $lang->story->report->storysPerEstimate->item = '预计工时'; $lang->story->report->storysPerChange->item = '变更次数'; -$lang->story->report->storysPerProduct->graph = new stdclass(); +$lang->story->report->storysPerProduct->graph = new stdclass(); $lang->story->report->storysPerModule->graph = new stdclass(); $lang->story->report->storysPerSource->graph = new stdclass(); $lang->story->report->storysPerPlan->graph = new stdclass(); diff --git a/module/story/model.php b/module/story/model.php index c95488dfd3..d703de575b 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1477,7 +1477,7 @@ class storyModel extends model $commonOption = $this->lang->story->report->options; $chartOption->graph->caption = $this->lang->story->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/story/view/report.html.php b/module/story/view/report.html.php index b85c8d8b74..f3c897bf34 100644 --- a/module/story/view/report.html.php +++ b/module/story/view/report.html.php @@ -11,6 +11,7 @@ */ ?> +
| - |
-
-
|