I want to make this data pointer dynamic, I will input this data pointer from my database. what shall i do? how can i solve this? I want to change only dataPoints. Also how to change the option completely? I am using Laravel 5.1
@section('page-content')
<div id="templatemo_main"><span class="main_top"></span>
<div id="content-viewer-div">
<div style="width:100%; height: 500px; ">
<div style="width: 30%; height: 500px; background: #ff6666;float: left ">
</div>
<div style="width: 70%; height: 500px; background: #dddddd; float: left;">
<div>
<div id="chartContainer" style="height: 300px; width: 100%;"></div>
</div>
<div>Pressure</div>
<div>Temperature</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="{{asset('js/ecgProcess/jquery-1.11.1.min.js')}}"></script>
<script type="text/javascript" src="{{asset('js/ecgProcess/jquery.canvasjs.min.js')}}"></script>
<script type="text/javascript">
$(function () {
//Better to construct options first and then pass it as a parameter
var options = {
title: {
text: "Patients ECG Signal"
},
animationEnabled: true,
data: [
{
type: "spline", //change it to line, area, column, pie, etc
dataPoints: [
{ x: 10, y: 10 },
{ x: 20, y: 12 },
{ x: 30, y: 8 },
{ x: 40, y: 14 },
{ x: 50, y: 6 },
{ x: 60, y: 24 },
{ x: 70, y: 4 },
{ x: 80, y: 10 },
{ x: 90, y: 12 },
{ x: 100, y: 8 },
{ x: 140, y: 14 },
{ x: 150, y: 6 },
{ x: 160, y: 24 },
{ x: 170, y: 4 },
{ x: 180, y: 10 }
]
}
]
};
$("#chartContainer").CanvasJSChart(options);
});
</script>
@stop
i j