resolve csv export issues

This commit is contained in:
Shreesh Arora
2024-05-03 15:46:48 +05:30
parent 1740165348
commit d343463ac1
4 changed files with 12 additions and 10 deletions

View File

@@ -210,7 +210,7 @@ abstract class ModuleGraphCore extends Module
if (isset($this->_values[$key])) {
// We don't want strings to be divided. Example: product name
if (is_numeric($this->_values[$key])) {
$this->_csv .= $this->_values[$key] / (($datas['type'] == 'pie') ? $total : 1);
$this->_csv .= $this->_values[$key] * 100 / (($datas['type'] == 'pie') ? $total : 1) . '%';
} else {
$this->_csv .= $this->_values[$key];
}
@@ -220,7 +220,7 @@ abstract class ModuleGraphCore extends Module
} else {
// We don't want strings to be divided. Example: product name
if (is_numeric($this->_values[$i][$key])) {
$this->_csv .= $this->_values[$i][$key] / (($datas['type'] == 'pie') ? $total : 1);
$this->_csv .= $this->_values[$i][$key] * 100 / (($datas['type'] == 'pie') ? $total : 1) . '%';
} else {
$this->_csv .= $this->_values[$i][$key];
}