I am using yii2, and in that I need to use temperatures.csv file to get a graph, while using normal php its working fine but in yii2, the path to the csv file causes an error.
My view file code is this:
<div id="graphdiv3"
style="width:500px; height:300px;"></div>
<script type="text/javascript">
var filename = "Date,Temperature\n" +
"2008-05-07,75\n" +
"2008-05-08,70\n" +
"2008-05-09,80\n";
console.log(filename);
g3 = new Dygraph(
document.getElementById("graphdiv3"),
"///var/www/devicesadmin/yii-app/views/data-chart/temperatures.csv",
{
legend: 'always',
title: 'NYC vs. SF',
showRoller: true,
rollPeriod: 14,
ylabel: 'Temperature (F)',
}
);
</script>
My csv file is in the view folder of this same file folder. filename Javascript variable is a sample of that csv file where it's working fine, but calling the file directly, causes it to return an error.
P.S using widgets is not fair as many options are not working.