Jump to content
JChartFX Community

zeebaah

Members
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About zeebaah

  • Rank
    Newbie
  1. Group bars

    my json looks like this [ { "1": { "user": [ { "name": "Morten 123", "procent": 40 }, { "name": "Spiller 13", "procent": 40 } ], "game": "1" }, "2": { "user": [ { "name": "Morten 123", "procent": 40 }, { "name": "Spiller 13", "procent": 40 } ], "game": "2" }, "3": { "user": [ { "name": "Spiller 13", "procent": 40 }, { "name": "Morten 123", "procent": 40 } ], "game": "3" } } ] Can i do it this way, or do i need to change it? I'm getting the data from my database using php and json...some games might be with 3 users while others is with 10..
  2. Group bars

    Hello, how ive been making some charts, and such using jChart and it looks great, how ever now i need to make some grouped bars... Ive got a few games where i need a bar for each users procentage correct answers Heres my json [ { "1": { "user": [ { "name": "Morten 123", "procent": 40 }, { "name": "Spiller 13", "procent": 40 } ], "game": "1" }, "2": { "user": [ { "name": "Morten 123", "procent": 40 }, { "name": "Spiller 13", "procent": 40 } ], "game": "2" }, "3": { "user": [ { "name": "Spiller 13", "procent": 40 }, { "name": "Morten 123", "procent": 40 } ], "game": "3" } } ] Thats by the var data = [{"Game":"Game1", "John":50, "Mark":60}, {"Game":"Game2", "John":20, "Mark":10}]; How ever id like 4 bars here, here they are grouped by game... So a label called game 1, with 2 bars 1 for mark and one for john. and the same for game 2.
  3. Loading datasource using json

    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 ) )
×