chartjs icon indicating copy to clipboard operation
chartjs copied to clipboard

linegraph.html page is not get displayed.

Open VidyaCK opened this issue 7 years ago • 15 comments

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

VidyaCK avatar Oct 23 '17 12:10 VidyaCK

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

yusufshakeel avatar Oct 23 '17 14:10 yusufshakeel

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 [email protected] 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 avatar Oct 24 '17 05:10 VidyaCK

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

On Tue, Oct 24, 2017 at 10:30 AM, Vidya kabber [email protected] 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 [email protected] 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 avatar Oct 24 '17 05:10 VidyaCK

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 [email protected] 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 [email protected] 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 [email protected] 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 avatar Oct 24 '17 06:10 VidyaCK

It worked. Problem solved.

On Tue, Oct 24, 2017 at 11:33 AM, Vidya kabber [email protected] 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 [email protected] 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 [email protected] 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 <[email protected]

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 avatar Oct 24 '17 06:10 VidyaCK

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

On Tue, Oct 24, 2017 at 12:10 PM, Vidya kabber [email protected] wrote:

It worked. Problem solved.

On Tue, Oct 24, 2017 at 11:33 AM, Vidya kabber [email protected] 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 [email protected] 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 <[email protected]

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 < [email protected]> 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 avatar Oct 24 '17 11:10 VidyaCK

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() {

/**

  • call the data.php file to fetch the result from db table. */ $.ajax({ url : "http://localhost:81/chartjs3/api/data.php", type : "GET", success : function(data){ console.log(data);

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 avatar Oct 24 '17 14:10 VidyaCK

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber [email protected] 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() {

/**

  • call the data.php file to fetch the result from db table. */ $.ajax({ url : "http://localhost:81/chartjs3/api/data.php", type : "GET", success : function(data){ console.log(data);

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 avatar Oct 25 '17 04:10 VidyaCK

Can you reply me soon?

On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber [email protected] wrote:

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber [email protected] 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() {

/**

  • call the data.php file to fetch the result from db table. */ $.ajax({ url : "http://localhost:81/chartjs3/api/data.php", type : "GET", success : function(data){ console.log(data);

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 avatar Oct 25 '17 08:10 VidyaCK

I am not getting where it went wrong?

On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber [email protected] wrote:

Can you reply me soon?

On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber [email protected] wrote:

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber [email protected] 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() {

/**

  • call the data.php file to fetch the result from db table. */ $.ajax({ url : "http://localhost:81/chartjs3/api/data.php", type : "GET", success : function(data){ console.log(data);

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 avatar Oct 25 '17 08:10 VidyaCK

Here I have score to no_tc.

On Wed, Oct 25, 2017 at 2:10 PM, Vidya kabber [email protected] wrote:

I am not getting where it went wrong?

On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber [email protected] wrote:

Can you reply me soon?

On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber [email protected] wrote:

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber [email protected] 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() {

/**

  • call the data.php file to fetch the result from db table. */ $.ajax({ url : "http://localhost:81/chartjs3/api/data.php", type : "GET", success : function(data){ console.log(data);

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 avatar Oct 25 '17 10:10 VidyaCK

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

On Wed, Oct 25, 2017 at 4:09 PM, Vidya kabber [email protected] wrote:

Here I have score to no_tc.

On Wed, Oct 25, 2017 at 2:10 PM, Vidya kabber [email protected] wrote:

I am not getting where it went wrong?

On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber [email protected] wrote:

Can you reply me soon?

On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber [email protected] wrote:

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber <[email protected]

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() {

/**

  • call the data.php file to fetch the result from db table. */ $.ajax({ url : "http://localhost:81/chartjs3/api/data.php", type : "GET", success : function(data){ console.log(data);

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 avatar Oct 25 '17 10:10 VidyaCK

Replay me, sir.

On Wed, Oct 25, 2017 at 4:18 PM, Vidya kabber [email protected] wrote:

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

On Wed, Oct 25, 2017 at 4:09 PM, Vidya kabber [email protected] wrote:

Here I have score to no_tc.

On Wed, Oct 25, 2017 at 2:10 PM, Vidya kabber [email protected] wrote:

I am not getting where it went wrong?

On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber [email protected] wrote:

Can you reply me soon?

On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber <[email protected]

wrote:

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber < [email protected]> 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() {

/**

  • call the data.php file to fetch the result from db table. */ $.ajax({ url : "http://localhost:81/chartjs3/api/data.php", type : "GET", success : function(data){ console.log(data);

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 avatar Oct 25 '17 14:10 VidyaCK

It is working fine. Thank you sir.

On Wed, Oct 25, 2017 at 7:35 PM, Vidya kabber [email protected] wrote:

Replay me, sir.

On Wed, Oct 25, 2017 at 4:18 PM, Vidya kabber [email protected] wrote:

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

On Wed, Oct 25, 2017 at 4:09 PM, Vidya kabber [email protected] wrote:

Here I have score to no_tc.

On Wed, Oct 25, 2017 at 2:10 PM, Vidya kabber [email protected] wrote:

I am not getting where it went wrong?

On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber <[email protected]

wrote:

Can you reply me soon?

On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber < [email protected]> wrote:

Reply me.

On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber < [email protected]> 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() {

/**

  • call the data.php file to fetch the result from db table. */ $.ajax({ url : "http://localhost:81/chartjs3/api/data.php", type : "GET", success : function(data){ console.log(data);

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 avatar Oct 26 '17 11:10 VidyaCK

For bar graph how to take the values from database.

VidyaCK avatar Nov 02 '17 13:11 VidyaCK