Percentage of what? You provide a total amount of votes for one item. From what do you want to get a percentage?
'value' => ($item->detail->FbVote + $item->detail->TwitVote + $item->detail->MailVote/100),
percentage = (part / total) * 100
You need your total amount of votes to be able to calculate your percentage. Dividing your sum by 100 will not give you a percentage.
LaurentMeganck
How To Add string To Value
'value' => ($item->detail->FbVote+$item->detail->TwitVote+$item->detail->MailVote*100)/100,'%',
Is Not Display ??
Or Change In Pie-Chart.js
First of all, still wrong calculation
Second
(($item->detail->FbVote+$item->detail->TwitVote+$item->detail->MailVote*100)/100) . '%'
wich is basically the same as
($item->detail->FbVote+$item->detail->TwitVote+$item->detail->MailVote) . '%'
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community