Support the ongoing development of Laravel.io →
Database Eloquent Views
Last updated 2 years ago.
0

Percentage of what? You provide a total amount of votes for one item. From what do you want to get a percentage?

0
      'value' => ($item->detail->FbVote + $item->detail->TwitVote + $item->detail->MailVote/100),

http://prntscr.com/bjgznw

Last updated 8 years ago.
0

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.

read

0

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

Last updated 8 years ago.
0

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) . '%'
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.