Click here to Skip to main content
15,311,014 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is it possible to use php in mvc razor. I have this Chart Js code embedded in an html page.

 var myLineChart = new Chart(ctx, {
type: 'line',
data: data,
options: options
});

I have a php array function which gets assigned to variable $jsonready. How can I add this variable to the data row property of chart Js.

Example:

What I have tried:

var myLineChart = new Chart(ctx, {
type: 'line',
data: <?= $jsonready ?>,
options: options
});
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900