-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Labels
Description
I was trying to do this (note Laravel templates are mixed in):
var byClassChart = new Chart(ctx).Doughnut([
@foreach ($allocations[$account->id]['by_class'] as $row)
{
value: ({{ $row['actual_dollars'] }}).toFixed(2),
percent: ({{ $row['target_percent'] }}),
color: colors[color],
highlight: lightColors[color++],
label: "{{ $row['asset_class_name'] }}"
},
@endforeach
], chartOptions);
var chartOptions = {
tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%=formatDollars(value)%> (<%=percent%>%)",
animation: false,
responsive: true
};However in the console I see that percent is not defined when the template is processed. Why sanitize extra properties out of the JSON passed to the chart? It would be much more convenient if I could do this than anything else.