yusufshakeel / chartjs

Drawing charts using version 1.x PLEASE CHECK version 2.x (Project Name: chartjs2)
https://dyclassroom.com/chartjs/getting-started
35 stars 241 forks source link

linegraph.html page is not get displayed. #5

Open VidyaCK opened 6 years ago

VidyaCK commented 6 years ago

I am a beginner to php. I am not getting how to display it. Can you help me solve this.

yusufshakeel commented 6 years ago

this repo is using older version of chartjs (v1.x) kindly check the new repo chartjs2 hope this helps code https://www.dyclassroom.com/chartjs/chartjs-how-to-create-line-graph-using-data-from-mysql-mariadb-table-and-php github repo https://github.com/yusufshakeel/chartjs2 tutorial video https://www.youtube.com/watch?v=nsnbv3wtW3g&index=5&list=PLG6ePePp5vvZLVjT5mgyxBpkbNBpuAwq9

VidyaCK commented 6 years ago

When I execute the data.php file it is displaying like this.What goes wrong here.

On Mon, Oct 23, 2017 at 7:48 PM, Yusuf Shakeel notifications@github.com wrote:

this repo is using older version of chartjs (v1.x) kindly check the new repo chartjs2 hope this helps code https://www.dyclassroom.com/chartjs/chartjs-how-to-create- line-graph-using-data-from-mysql-mariadb-table-and-php github repo https://github.com/yusufshakeel/chartjs2 tutorial video https://www.youtube.com/watch?v=nsnbv3wtW3g&index=5&list= PLG6ePePp5vvZLVjT5mgyxBpkbNBpuAwq9

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yusufshakeel/chartjs/issues/5#issuecomment-338673849, or mute the thread https://github.com/notifications/unsubscribe-auth/Aff4OPt9mZSZZ9HPOJbcOSjIrJbPZt6rks5svKAYgaJpZM4QCzC6 .

VidyaCK commented 6 years ago

Sir,How to solve this? I am not getting where it went wrong?

On Tue, Oct 24, 2017 at 10:30 AM, Vidya kabber vidya.merahkee@gmail.com wrote:

When I execute the data.php file it is displaying like this.What goes wrong here.

On Mon, Oct 23, 2017 at 7:48 PM, Yusuf Shakeel notifications@github.com wrote:

this repo is using older version of chartjs (v1.x) kindly check the new repo chartjs2 hope this helps code https://www.dyclassroom.com/chartjs/chartjs-how-to-create-li ne-graph-using-data-from-mysql-mariadb-table-and-php github repo https://github.com/yusufshakeel/chartjs2 tutorial video https://www.youtube.com/watch?v=nsnbv3wtW3g&index=5&list=PLG 6ePePp5vvZLVjT5mgyxBpkbNBpuAwq9

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yusufshakeel/chartjs/issues/5#issuecomment-338673849, or mute the thread https://github.com/notifications/unsubscribe-auth/Aff4OPt9mZSZZ9HPOJbcOSjIrJbPZt6rks5svKAYgaJpZM4QCzC6 .

VidyaCK commented 6 years ago

In data.php file, in " $result = $mysqli->query($query);" line it is giving undefined variable.

On Tue, Oct 24, 2017 at 10:58 AM, Vidya kabber vidya.merahkee@gmail.com wrote:

Sir,How to solve this? I am not getting where it went wrong?

On Tue, Oct 24, 2017 at 10:30 AM, Vidya kabber vidya.merahkee@gmail.com wrote:

When I execute the data.php file it is displaying like this.What goes wrong here.

On Mon, Oct 23, 2017 at 7:48 PM, Yusuf Shakeel notifications@github.com wrote:

this repo is using older version of chartjs (v1.x) kindly check the new repo chartjs2 hope this helps code https://www.dyclassroom.com/chartjs/chartjs-how-to-create-li ne-graph-using-data-from-mysql-mariadb-table-and-php github repo https://github.com/yusufshakeel/chartjs2 tutorial video https://www.youtube.com/watch?v=nsnbv3wtW3g&index=5&list=PLG 6ePePp5vvZLVjT5mgyxBpkbNBpuAwq9

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yusufshakeel/chartjs/issues/5#issuecomment-338673849, or mute the thread https://github.com/notifications/unsubscribe-auth/Aff4OPt9mZSZZ9HPOJbcOSjIrJbPZt6rks5svKAYgaJpZM4QCzC6 .

VidyaCK commented 6 years ago

It worked. Problem solved.

On Tue, Oct 24, 2017 at 11:33 AM, Vidya kabber vidya.merahkee@gmail.com wrote:

In data.php file, in " $result = $mysqli->query($query);" line it is giving undefined variable.

On Tue, Oct 24, 2017 at 10:58 AM, Vidya kabber vidya.merahkee@gmail.com wrote:

Sir,How to solve this? I am not getting where it went wrong?

On Tue, Oct 24, 2017 at 10:30 AM, Vidya kabber vidya.merahkee@gmail.com wrote:

When I execute the data.php file it is displaying like this.What goes wrong here.

On Mon, Oct 23, 2017 at 7:48 PM, Yusuf Shakeel <notifications@github.com

wrote:

this repo is using older version of chartjs (v1.x) kindly check the new repo chartjs2 hope this helps code https://www.dyclassroom.com/chartjs/chartjs-how-to-create-li ne-graph-using-data-from-mysql-mariadb-table-and-php github repo https://github.com/yusufshakeel/chartjs2 tutorial video https://www.youtube.com/watch?v=nsnbv3wtW3g&index=5&list=PLG 6ePePp5vvZLVjT5mgyxBpkbNBpuAwq9

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yusufshakeel/chartjs/issues/5#issuecomment-338673849, or mute the thread https://github.com/notifications/unsubscribe-auth/Aff4OPt9mZSZZ9HPOJbcOSjIrJbPZt6rks5svKAYgaJpZM4QCzC6 .

VidyaCK commented 6 years ago

Thank you so much sir for for help. It is working fine.

On Tue, Oct 24, 2017 at 12:10 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

It worked. Problem solved.

On Tue, Oct 24, 2017 at 11:33 AM, Vidya kabber vidya.merahkee@gmail.com wrote:

In data.php file, in " $result = $mysqli->query($query);" line it is giving undefined variable.

On Tue, Oct 24, 2017 at 10:58 AM, Vidya kabber vidya.merahkee@gmail.com wrote:

Sir,How to solve this? I am not getting where it went wrong?

On Tue, Oct 24, 2017 at 10:30 AM, Vidya kabber <vidya.merahkee@gmail.com

wrote:

When I execute the data.php file it is displaying like this.What goes wrong here.

On Mon, Oct 23, 2017 at 7:48 PM, Yusuf Shakeel < notifications@github.com> wrote:

this repo is using older version of chartjs (v1.x) kindly check the new repo chartjs2 hope this helps code https://www.dyclassroom.com/chartjs/chartjs-how-to-create-li ne-graph-using-data-from-mysql-mariadb-table-and-php github repo https://github.com/yusufshakeel/chartjs2 tutorial video https://www.youtube.com/watch?v=nsnbv3wtW3g&index=5&list=PLG 6ePePp5vvZLVjT5mgyxBpkbNBpuAwq9

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yusufshakeel/chartjs/issues/5#issuecomment-338673849, or mute the thread https://github.com/notifications/unsubscribe-auth/Aff4OPt9mZSZZ9HPOJbcOSjIrJbPZt6rks5svKAYgaJpZM4QCzC6 .

VidyaCK commented 6 years ago

Can you help me to solve this. Sir, I have created other database. It is same as example database. Below I have pasted that below,

[image: Inline image 1]

When I open the line-dp-php.html through browser, it display as below,

[image: Inline image 2] In line-dp-php.js I have made these changes,

$(document).ready(function() {

/**

var score = { pass : [], fail : [] };

var len = data.length;

for (var i = 0; i < len; i++) { if (data[i].result == "pass") { score.pass.push(data[i].score); } else if (data[i].result == "fail") { score.fail.push(data[i].score); } }

//get canvas var ctx = $("#line-chartcanvas");

var data = { labels : ["ver1", "ver2", "ver3", "ver4", "ver5"], datasets : [ { label : "pass testcase", data : score.pass, backgroundColor : "green", borderColor : "lightgreen", fill : false, lineTension : 0, pointRadius : 5 }, { label : "fail testcase", data : score.fail, backgroundColor : "red", borderColor : "lightred", fill : false, lineTension : 0, pointRadius : 5 } ] };

var options = { title : { display : true, position : "top", text : "Line Graph", fontSize : 18, fontColor : "#111" }, legend : { display : true, position : "bottom" } };

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

}, error : function(data) { console.log(data); } });

});

VidyaCK commented 6 years ago

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

Can you help me to solve this. Sir, I have created other database. It is same as example database. Below I have pasted that below,

[image: Inline image 1]

When I open the line-dp-php.html through browser, it display as below,

[image: Inline image 2] In line-dp-php.js I have made these changes,

$(document).ready(function() {

/**

var score = { pass : [], fail : [] };

var len = data.length;

for (var i = 0; i < len; i++) { if (data[i].result == "pass") { score.pass.push(data[i].score); } else if (data[i].result == "fail") { score.fail.push(data[i].score); } }

//get canvas var ctx = $("#line-chartcanvas");

var data = { labels : ["ver1", "ver2", "ver3", "ver4", "ver5"], datasets : [ { label : "pass testcase", data : score.pass, backgroundColor : "green", borderColor : "lightgreen", fill : false, lineTension : 0, pointRadius : 5 }, { label : "fail testcase", data : score.fail, backgroundColor : "red", borderColor : "lightred", fill : false, lineTension : 0, pointRadius : 5 } ] };

var options = { title : { display : true, position : "top", text : "Line Graph", fontSize : 18, fontColor : "#111" }, legend : { display : true, position : "bottom" } };

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

}, error : function(data) { console.log(data); } });

});

VidyaCK commented 6 years ago

Can you reply me soon?

On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber vidya.merahkee@gmail.com wrote:

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

Can you help me to solve this. Sir, I have created other database. It is same as example database. Below I have pasted that below,

[image: Inline image 1]

When I open the line-dp-php.html through browser, it display as below,

[image: Inline image 2] In line-dp-php.js I have made these changes,

$(document).ready(function() {

/**

var score = { pass : [], fail : [] };

var len = data.length;

for (var i = 0; i < len; i++) { if (data[i].result == "pass") { score.pass.push(data[i].score); } else if (data[i].result == "fail") { score.fail.push(data[i].score); } }

//get canvas var ctx = $("#line-chartcanvas");

var data = { labels : ["ver1", "ver2", "ver3", "ver4", "ver5"], datasets : [ { label : "pass testcase", data : score.pass, backgroundColor : "green", borderColor : "lightgreen", fill : false, lineTension : 0, pointRadius : 5 }, { label : "fail testcase", data : score.fail, backgroundColor : "red", borderColor : "lightred", fill : false, lineTension : 0, pointRadius : 5 } ] };

var options = { title : { display : true, position : "top", text : "Line Graph", fontSize : 18, fontColor : "#111" }, legend : { display : true, position : "bottom" } };

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

}, error : function(data) { console.log(data); } });

});

VidyaCK commented 6 years ago

I am not getting where it went wrong?

On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

Can you reply me soon?

On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber vidya.merahkee@gmail.com wrote:

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

Can you help me to solve this. Sir, I have created other database. It is same as example database. Below I have pasted that below,

[image: Inline image 1]

When I open the line-dp-php.html through browser, it display as below,

[image: Inline image 2] In line-dp-php.js I have made these changes,

$(document).ready(function() {

/**

var score = { pass : [], fail : [] };

var len = data.length;

for (var i = 0; i < len; i++) { if (data[i].result == "pass") { score.pass.push(data[i].score); } else if (data[i].result == "fail") { score.fail.push(data[i].score); } }

//get canvas var ctx = $("#line-chartcanvas");

var data = { labels : ["ver1", "ver2", "ver3", "ver4", "ver5"], datasets : [ { label : "pass testcase", data : score.pass, backgroundColor : "green", borderColor : "lightgreen", fill : false, lineTension : 0, pointRadius : 5 }, { label : "fail testcase", data : score.fail, backgroundColor : "red", borderColor : "lightred", fill : false, lineTension : 0, pointRadius : 5 } ] };

var options = { title : { display : true, position : "top", text : "Line Graph", fontSize : 18, fontColor : "#111" }, legend : { display : true, position : "bottom" } };

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

}, error : function(data) { console.log(data); } });

});

VidyaCK commented 6 years ago

Here I have score to no_tc.

On Wed, Oct 25, 2017 at 2:10 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

I am not getting where it went wrong?

On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

Can you reply me soon?

On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber vidya.merahkee@gmail.com wrote:

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

Can you help me to solve this. Sir, I have created other database. It is same as example database. Below I have pasted that below,

[image: Inline image 1]

When I open the line-dp-php.html through browser, it display as below,

[image: Inline image 2] In line-dp-php.js I have made these changes,

$(document).ready(function() {

/**

var score = { pass : [], fail : [] };

var len = data.length;

for (var i = 0; i < len; i++) { if (data[i].result == "pass") { score.pass.push(data[i].score); } else if (data[i].result == "fail") { score.fail.push(data[i].score); } }

//get canvas var ctx = $("#line-chartcanvas");

var data = { labels : ["ver1", "ver2", "ver3", "ver4", "ver5"], datasets : [ { label : "pass testcase", data : score.pass, backgroundColor : "green", borderColor : "lightgreen", fill : false, lineTension : 0, pointRadius : 5 }, { label : "fail testcase", data : score.fail, backgroundColor : "red", borderColor : "lightred", fill : false, lineTension : 0, pointRadius : 5 } ] };

var options = { title : { display : true, position : "top", text : "Line Graph", fontSize : 18, fontColor : "#111" }, legend : { display : true, position : "bottom" } };

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

}, error : function(data) { console.log(data); } });

});

VidyaCK commented 6 years ago

what is data in that? I didn't get that.

On Wed, Oct 25, 2017 at 4:09 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

Here I have score to no_tc.

On Wed, Oct 25, 2017 at 2:10 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

I am not getting where it went wrong?

On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

Can you reply me soon?

On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber vidya.merahkee@gmail.com wrote:

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber <vidya.merahkee@gmail.com

wrote:

Can you help me to solve this. Sir, I have created other database. It is same as example database. Below I have pasted that below,

[image: Inline image 1]

When I open the line-dp-php.html through browser, it display as below,

[image: Inline image 2] In line-dp-php.js I have made these changes,

$(document).ready(function() {

/**

var score = { pass : [], fail : [] };

var len = data.length;

for (var i = 0; i < len; i++) { if (data[i].result == "pass") { score.pass.push(data[i].score); } else if (data[i].result == "fail") { score.fail.push(data[i].score); } }

//get canvas var ctx = $("#line-chartcanvas");

var data = { labels : ["ver1", "ver2", "ver3", "ver4", "ver5"], datasets : [ { label : "pass testcase", data : score.pass, backgroundColor : "green", borderColor : "lightgreen", fill : false, lineTension : 0, pointRadius : 5 }, { label : "fail testcase", data : score.fail, backgroundColor : "red", borderColor : "lightred", fill : false, lineTension : 0, pointRadius : 5 } ] };

var options = { title : { display : true, position : "top", text : "Line Graph", fontSize : 18, fontColor : "#111" }, legend : { display : true, position : "bottom" } };

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

}, error : function(data) { console.log(data); } });

});

VidyaCK commented 6 years ago

Replay me, sir.

On Wed, Oct 25, 2017 at 4:18 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

what is data in that? I didn't get that.

On Wed, Oct 25, 2017 at 4:09 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

Here I have score to no_tc.

On Wed, Oct 25, 2017 at 2:10 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

I am not getting where it went wrong?

On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

Can you reply me soon?

On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber <vidya.merahkee@gmail.com

wrote:

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber < vidya.merahkee@gmail.com> wrote:

Can you help me to solve this. Sir, I have created other database. It is same as example database. Below I have pasted that below,

[image: Inline image 1]

When I open the line-dp-php.html through browser, it display as below,

[image: Inline image 2] In line-dp-php.js I have made these changes,

$(document).ready(function() {

/**

var score = { pass : [], fail : [] };

var len = data.length;

for (var i = 0; i < len; i++) { if (data[i].result == "pass") { score.pass.push(data[i].score); } else if (data[i].result == "fail") { score.fail.push(data[i].score); } }

//get canvas var ctx = $("#line-chartcanvas");

var data = { labels : ["ver1", "ver2", "ver3", "ver4", "ver5"], datasets : [ { label : "pass testcase", data : score.pass, backgroundColor : "green", borderColor : "lightgreen", fill : false, lineTension : 0, pointRadius : 5 }, { label : "fail testcase", data : score.fail, backgroundColor : "red", borderColor : "lightred", fill : false, lineTension : 0, pointRadius : 5 } ] };

var options = { title : { display : true, position : "top", text : "Line Graph", fontSize : 18, fontColor : "#111" }, legend : { display : true, position : "bottom" } };

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

}, error : function(data) { console.log(data); } });

});

VidyaCK commented 6 years ago

It is working fine. Thank you sir.

On Wed, Oct 25, 2017 at 7:35 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

Replay me, sir.

On Wed, Oct 25, 2017 at 4:18 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

what is data in that? I didn't get that.

On Wed, Oct 25, 2017 at 4:09 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

Here I have score to no_tc.

On Wed, Oct 25, 2017 at 2:10 PM, Vidya kabber vidya.merahkee@gmail.com wrote:

I am not getting where it went wrong?

On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber <vidya.merahkee@gmail.com

wrote:

Can you reply me soon?

On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber < vidya.merahkee@gmail.com> wrote:

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber < vidya.merahkee@gmail.com> wrote:

Can you help me to solve this. Sir, I have created other database. It is same as example database. Below I have pasted that below,

[image: Inline image 1]

When I open the line-dp-php.html through browser, it display as below,

[image: Inline image 2] In line-dp-php.js I have made these changes,

$(document).ready(function() {

/**

var score = { pass : [], fail : [] };

var len = data.length;

for (var i = 0; i < len; i++) { if (data[i].result == "pass") { score.pass.push(data[i].score); } else if (data[i].result == "fail") { score.fail.push(data[i].score); } }

//get canvas var ctx = $("#line-chartcanvas");

var data = { labels : ["ver1", "ver2", "ver3", "ver4", "ver5"], datasets : [ { label : "pass testcase", data : score.pass, backgroundColor : "green", borderColor : "lightgreen", fill : false, lineTension : 0, pointRadius : 5 }, { label : "fail testcase", data : score.fail, backgroundColor : "red", borderColor : "lightred", fill : false, lineTension : 0, pointRadius : 5 } ] };

var options = { title : { display : true, position : "top", text : "Line Graph", fontSize : 18, fontColor : "#111" }, legend : { display : true, position : "bottom" } };

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

}, error : function(data) { console.log(data); } });

});

VidyaCK commented 6 years ago

For bar graph how to take the values from database.