This commit is contained in:
宋辰轩
2024-05-07 16:35:50 +08:00
parent c97c9f5665
commit 244443cfa7
+7 -1
View File
@@ -453,12 +453,18 @@ class chartModel extends model
$optionList = $this->getSysOptions($fields[$group]['type'], $fields[$group]['object'], $fields[$group]['field']);
foreach($xLabels as $index => $xLabel) $xLabels[$index] = isset($optionList[$xLabel]) ? $optionList[$xLabel] : $xLabel;
$position = 'top';
if($settings['type'] == 'stackedBar' or $settings['type'] == 'stackedBarY') $position = 'inside';
if($settings['type'] == 'cluBarY') $position = 'right';
$label = array('show' => true, 'position' => $position, 'formatter' => '{c}');
$series = array();
foreach($yDatas as $index => $yData)
{
$fieldName = $this->chartTao->switchFieldName($fields, $langs, $metrics, $index);
$seriesName = $fieldName . '(' . $this->lang->chart->aggList[$aggs[$index]] . ')';
$series[] = array('name' => $seriesName, 'data' => $yData, 'type' => 'bar', 'stack' => $stack);
$series[] = array('name' => $seriesName, 'data' => $yData, 'type' => 'bar', 'stack' => $stack, 'label' => $label);
}
$grid = array('left' => '3%', 'right' => '4%', 'bottom' => '3%', 'containLabel' => true);