-
AuthorPosts
-
October 6, 2014 at 6:33 am #201857
Hi,
I would ask for help with dividers thousands (decimal) of pie chart (Ja google chart).
I’m trying to change the way of displaying the amount in a balloonexample:
123.456000I need
123.456.000,00Where can I change this value.
thanks a lot
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
October 6, 2014 at 6:51 am #551933Hi there,
Have you tried with this php function:
http://php.net/manual/en/function.number-format.php
Thank you,
Viet VuOctober 6, 2014 at 6:56 am #551934I watched and tried to insert into mod_jagooglechart.php, but failed. I would ask you if you could help me which part and where to insert.
thanks a lot
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
October 6, 2014 at 6:57 am #551935Hi there,
For sure. Please provide me your site URL. I’ll help you to locate which file.Thank you,
Viet VuOctober 6, 2014 at 7:01 am #551936i send link to PM. Thx
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
October 6, 2014 at 7:12 am #551940Hi there,
I have just checked and got this one:
$js = "
google.setOnLoadCallback({$funcChart});
function {$funcChart}() {
var data = google.visualization.arrayToDataTable(".json_encode($data).");
var options = ".json_encode($options).";
var chart = new google.visualization.{$chart}(document.getElementById('{$container}'));
chart.draw(data, options);
}";
File
mod_jagooglechart.php
$data contain value for title & number.
Well. $data is came from
$data = array();
for ($i=0;$i<count($rows);$i++) {
$row = explode(',', $rows[$i]);
$tmp = array();
if($i==0) {
//title
foreach ($row as $cell) {
$tmp[] = (string) trim($cell);
}
} else {
for($j=0;$j<count($row);$j++) {
if($j == 0) {
$tmp[] = (string) (trim($row[$j]));//horizontal axis - item title
} else {
$tmp[] = (float) (trim($row[$j]));
}
}
}
$data[] = $tmp;
}
As you can see we’r using (float) variable type here
$tmp[] = (float) (trim($row[$j]));
You can change it into your format by use
$tmp[] = number_format ( (float) (trim($row[$j])) , 2 );
Please ref
http://php.net/manual/en/function.number-format.php
For detail and more options.Thank you,
Viet VuOctober 6, 2014 at 7:36 am #551945i put this code:
$tmp[] = number_format ( (float) (trim($row[$j])) , 2 );but no effect
October 6, 2014 at 7:37 am #551946Not see number in pie chart
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
October 6, 2014 at 7:49 am #551947Hi there,
I have you tried to clear cache. Or please provide me your FTP & backend access.I’ll try to help you.Thank you,
Viet VuOctober 6, 2014 at 7:55 am #551948Unfortunately I can not give you the ftp details. Can you try to point out the problem.
October 6, 2014 at 7:56 am #551949Yes. I cleared the cache
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
October 6, 2014 at 8:00 am #551950Hi there,
# Please make sure you have cleared cache: Browser / Server etc.. and do Ctrl F5
# To debug please insert this code
print_r ($data);
After
$data[] = $tmp;
}
And give me this.In my localhost i only do read code to find out logic 🙂
Thank you,
Viet VuOctober 6, 2014 at 8:11 am #551952You can see now error message. Link page of my web
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
October 6, 2014 at 8:22 am #551953Hi there
Array ( [0] => Array ( [0] => Proracun [1] => kune )) Array ( [0] => Array ( [0] => Proracun [1] => kune )[1] => Array ( [0] => Prihodi od poreza [1] => 83,305,820.00 )) Array ( [0] => Array ( [0] => Proracun [1] => kune )[1] => Array ( [0] => Prihodi od poreza [1] => 83,305,820.00 )[2] => Array ( [0] => Prihodi od pomoći [1] => 31,168,438.00 ))
Look like it’s valid format as you expected. Isn’t it ?
It’s bit hard for me to inspect code without touching it 🙂Thank you,
Viet VuOctober 6, 2014 at 8:27 am #551954Format is ok. But not see graph
-
AuthorPosts
This topic contains 22 replies, has 2 voices, and was last updated by branimir131 10 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum