fixed integer data is shown as decimal in pie chart

This commit is contained in:
Shreesh Arora
2024-07-04 12:17:13 +05:30
parent b570b76fd3
commit c7bcb85d9a
5 changed files with 12 additions and 6 deletions

View File

@@ -92,6 +92,7 @@ class GraphNvD3 extends ModuleGraphEngine
.y(function(d) { return d.value; })
.showLabels(true)
.labelType("percent")'
.((isset($params['format']) && $params['format']) ? '.valueFormat(d3.format("'.$params['format'].'"))' : '')
);
return '

View File

@@ -62,7 +62,7 @@ class StatsBestCategories extends ModuleGrid
),
array(
'id' => 'totalRoomsBooked',
'header' => $this->l('Rooms booked'),
'header' => $this->l('Room nights booked'),
'dataIndex' => 'totalRoomsBooked',
'align' => 'center',
'tooltip' => $this->l('The room nights booked for the hotel.'),

View File

@@ -70,7 +70,7 @@ class StatsBestProducts extends ModuleGrid
),
array(
'id' => 'totalRoomsBooked',
'header' => $this->l('Rooms booked'),
'header' => $this->l('Room nights booked'),
'dataIndex' => 'totalRoomsBooked',
'tooltip' => $this->l('The room nights booked for the room type.'),
'align' => 'center',

View File

@@ -116,7 +116,8 @@ class StatsPersonalInfos extends ModuleGraph
<div class="col-lg-8">
'.$this->engine(array(
'type' => 'pie',
'option' => 'gender'
'option' => 'gender',
'format' => 'd'
)).'
</div>
<div class="col-lg-4">
@@ -133,7 +134,8 @@ class StatsPersonalInfos extends ModuleGraph
<div class="col-lg-8">
'.$this->engine(array(
'type' => 'pie',
'option' => 'age'
'option' => 'age',
'format' => 'd'
)).'
</div>
<div class="col-lg-4">
@@ -150,7 +152,8 @@ class StatsPersonalInfos extends ModuleGraph
<div class="col-lg-8">
'.$this->engine(array(
'type' => 'pie',
'option' => 'country'
'option' => 'country',
'format' => 'd'
)).'
</div>
<div class="col-lg-4">
@@ -167,7 +170,8 @@ class StatsPersonalInfos extends ModuleGraph
<div class="col-lg-8">
'.$this->engine(array(
'type' => 'pie',
'option' => 'currency'
'option' => 'currency',
'format' => 'd'
)).'
</div>
<div class="col-lg-4">

View File

@@ -176,6 +176,7 @@ class StatsSales extends ModuleGraph
'.($totals['orderCount'] ? $this->engine(array(
'type' => 'pie',
'option' => '3-'.(int)Tools::getValue('id_country').'-'.(int)Tools::getValue('id_hotel'),
'format' => 'd'
)) : $this->l('No orders found.')).'
</div>
<div class="col-lg-4">