diff --git a/module/chart/config.php b/module/chart/config.php index a10083cf02..7d0741e273 100644 --- a/module/chart/config.php +++ b/module/chart/config.php @@ -2,6 +2,8 @@ $config->chart->widthInput = 128; $config->chart->widthDate = 248; +$config->chart->canLabelRotate = array('line', 'cluBarX', 'cluBarY', 'stackedBar', 'stackedBarY'); + $config->chart->dateConvert = array(); $config->chart->dateConvert['year'] = 'YEAR'; $config->chart->dateConvert['month'] = 'MONTH'; diff --git a/module/chart/control.php b/module/chart/control.php index 43a8d108fc..fae3b4a364 100644 --- a/module/chart/control.php +++ b/module/chart/control.php @@ -212,6 +212,13 @@ class chart extends control break; } + // 对于能进行旋转的图表,判断有没有设置旋转 + if(in_array($type, $this->config->chart->canLabelRotate)) + { + if(isset($settings['rotateX']) and $settings['rotateX'] == 'use') $data['xAxis']['axisLabel'] = array('rotate' => 30); + if(isset($settings['rotateY']) and $settings['rotateY'] == 'use') $data['yAxis']['axisLabel'] = array('rotate' => 30); + } + echo json_encode($data); } }