[ASTPPCOM-72] Chart cannot display profit larger than 1000 Created: 21/Aug/16  Updated: 01/Apr/21  Resolved: 01/Apr/21

Status: Done
Project: ASTPP Community
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature
Reporter: fozzygo4 Assignee: Samir Doshi
Resolution: Done Votes: 0
Labels: approved, bug_confirmed, bug_fixed, new_bug
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The dashboard chart does not display profit correctly if value is larger than 1000 as Highchart does not handle the thousand separator correctly. Example:

Profit value = 1200.00
With LOCALE en_US thousand separator is ","
This makes the chart value 1,200.00

The chart will show 1 and not 1,200.00 as it breaks the value after the ",".



 Comments   
Comment by dev-astpp [ 22/Aug/16 ]

As we check in our system it display correct value for all dashboard graph. So can you please provide screenshot?

Comment by fozzygo4 [ 22/Aug/16 ]

Ok see screenshots. I am only displaying the profit line on the graph in this example. I have changed line 133 on /astpp/application/modules/dashboard/controllers/dashboard.php and removed the currency function from profit to make it work correctly. Line 133 is commented out for line 134.

          //$json_data['profit'][]=  array((string)$acc_arr[$day]['day'],(float) $this->common_model->calculate_currency($acc_arr[$day]['profit']));
          $json_data['profit'][]=  array((string)$acc_arr[$day]['day'],(float) $acc_arr[$day]['profit']);

Day 10 is showing 1 ZAR as profit but it should be 1186.34 ZAR. Day 8 and any other day that is bellow 1000 displays correct because there is no , for a thousand separator.

Once I applied the code above to not run the currency function, it displays the graph correctly because there is no , thousand separator.

Comment by dev-astpp [ 10/Sep/16 ]

Fixed. Please take latest source and test it out.

Generated at Sat Feb 10 07:13:55 CET 2024 using Jira 8.13.3#813003-sha1:22ebedbb75c99b147c66f14e031dd8a2d214753a.