Currency format in ChartJS #1219
Replies: 1 comment
-
Hey @Read2uk Let's say you want to display:
However, the raw data point has to be a number, not a string(145K). I understand where you want it, but the scope that is possible right now is:
$this->chart->dataset('Sales', 'bar', [
$sales_6_days_ago/1000,
$sales_5_days_ago/1000,
$sales_4_days_ago/1000,
$sales_3_days_ago/1000,
$sales_2_days_ago/1000,
$yesterday_sales/1000,
$today_sales/1000,
])->color('rgb(66, 186, 150, 1)')
->backgroundColor('rgb(66, 186, 150, 0.4)'); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I am trying to build a few sales reports with ChartJS widgets but I am struggling to format the values;
If I format the figures in MySQL to have the correct format, they won't display in chartjs.
For example number formats I am dealing with: 14514313.31 , 17519321.73
How can I format to be in readable currency format? Do you guys have an example please?
There is documentation on how to do it if chartjs was in Javascript but not finding any documentation on php.
Beta Was this translation helpful? Give feedback.
All reactions