I am trying to render chart
using canvasjs
. I am working on yii2
. I am following an if..else
condition and on the basis of it I am trying to render the chart. The chart view is a partial view which should only be seen when a particular condition is true. The condition is dependent upon the user’s choice that what he wants to see. The user will press the query
button and then that condition will be checked and when the condition is true I am trying to render that partial view in which I have added my chart code. Can anyone please help me it that?
if($type == "403")
{
$columns = [
['class' => 'yii\grid\SerialColumn'],
'Device_ID',
'Customer_ID',
'MSN',
'kWh',
'Data_Date_Time',
];
$this->render('_kwhChart', [
'dataProvider' => $dataProvider,
]) ;
}