-
-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linegraph.html page is not get displayed. #5
Comments
this repo is using older version of chartjs (v1.x) kindly check the new repo chartjs2 |
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 ***@***.***> 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
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Aff4OPt9mZSZZ9HPOJbcOSjIrJbPZt6rks5svKAYgaJpZM4QCzC6>
.
|
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 ***@***.***>
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
> <#5 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/Aff4OPt9mZSZZ9HPOJbcOSjIrJbPZt6rks5svKAYgaJpZM4QCzC6>
> .
>
|
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 ***@***.***>
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 ***@***.***>
> 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
>> <#5 (comment)>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/Aff4OPt9mZSZZ9HPOJbcOSjIrJbPZt6rks5svKAYgaJpZM4QCzC6>
>> .
>>
>
>
|
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 ***@***.***>
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 ***@***.***>
> 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 ***@***.***
>> > 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
>>> <#5 (comment)>,
>>> or mute the thread
>>> <https://github.com/notifications/unsubscribe-auth/Aff4OPt9mZSZZ9HPOJbcOSjIrJbPZt6rks5svKAYgaJpZM4QCzC6>
>>> .
>>>
>>
>>
>
|
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 ***@***.***>
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 ***@***.***>
> 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 ***@***.***
>> > 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 <
>>> ***@***.***> 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
>>>> <#5 (comment)>,
>>>> or mute the thread
>>>> <https://github.com/notifications/unsubscribe-auth/Aff4OPt9mZSZZ9HPOJbcOSjIrJbPZt6rks5svKAYgaJpZM4QCzC6>
>>>> .
>>>>
>>>
>>>
>>
>
|
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);
}
});
});
|
Reply me.
…On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber ***@***.***> 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);
}
});
});
|
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 ***@***.***>
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);
> }
> });
>
> });
>
|
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 ***@***.***>
wrote:
> Reply me.
>
> On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber ***@***.***>
> 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);
>> }
>> });
>>
>> });
>>
>
>
|
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 ***@***.***>
wrote:
> Can you reply me soon?
>
> On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber ***@***.***>
> wrote:
>
>> Reply me.
>>
>> On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber ***@***.***>
>> 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);
>>> }
>>> });
>>>
>>> });
>>>
>>
>>
>
|
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 ***@***.***>
wrote:
> I am not getting where it went wrong?
>
> On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber ***@***.***>
> wrote:
>
>> Can you reply me soon?
>>
>> On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber ***@***.***>
>> wrote:
>>
>>> Reply me.
>>>
>>> On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber ***@***.***
>>> > 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);
>>>> }
>>>> });
>>>>
>>>> });
>>>>
>>>
>>>
>>
>
|
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 ***@***.***>
wrote:
> Here I have score to no_tc.
>
> On Wed, Oct 25, 2017 at 2:10 PM, Vidya kabber ***@***.***>
> wrote:
>
>> I am not getting where it went wrong?
>>
>> On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber ***@***.***>
>> wrote:
>>
>>> Can you reply me soon?
>>>
>>> On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber ***@***.***
>>> > wrote:
>>>
>>>> Reply me.
>>>>
>>>> On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber <
>>>> ***@***.***> 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);
>>>>> }
>>>>> });
>>>>>
>>>>> });
>>>>>
>>>>
>>>>
>>>
>>
>
|
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 ***@***.***>
wrote:
> what is data in that? I didn't get that.
>
> On Wed, Oct 25, 2017 at 4:09 PM, Vidya kabber ***@***.***>
> wrote:
>
>> Here I have score to no_tc.
>>
>> On Wed, Oct 25, 2017 at 2:10 PM, Vidya kabber ***@***.***>
>> wrote:
>>
>>> I am not getting where it went wrong?
>>>
>>> On Wed, Oct 25, 2017 at 2:05 PM, Vidya kabber ***@***.***
>>> > wrote:
>>>
>>>> Can you reply me soon?
>>>>
>>>> On Wed, Oct 25, 2017 at 9:54 AM, Vidya kabber <
>>>> ***@***.***> wrote:
>>>>
>>>>> Reply me.
>>>>>
>>>>> On Tue, Oct 24, 2017 at 7:43 PM, Vidya kabber <
>>>>> ***@***.***> 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);
>>>>>> }
>>>>>> });
>>>>>>
>>>>>> });
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
|
For bar graph how to take the values from database. |
I am a beginner to php. I am not getting how to display it. Can you help me solve this.
The text was updated successfully, but these errors were encountered: