Jump to content
JChartFX Community
  • 0

Loading datasource using json


zeebaah

Question



Hello, I'm trying to make a chart where i got the ability to change datasource, so the charts look 1, 7 or 30 days back etc....

If i get the data from php using chart1.setDataSource(<?php echo json_encode($chartArray);?> then it works perfektly, how ever id like to make it getting the data from another file giving me the option to change datasets bit easier, and then using 

$.ajax({

type: "GET",

url: "test.php",

data: {'getmessage': 'getmessage'},

dataType: "json",

success: function(data) {

chart1.setDataSource(data);

}

});

How ever thats not working.

my test.php gives the same json dataset as before only just moved to the test.php file

Any ideas about where im going wrong? 

Oh and here is my array

Array ( 

[0] => Array (

[Procent rigtige] => 100

[Antal rigtige] => 4

[Antal mulige] => 4

[Date] => Januar-1970 )

[1] => Array (

[Procent rigtige] => 100

[Antal rigtige] => 4

[Antal mulige] => 4

[Date] => Februar-2014 )

)
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...