shinsengumi Posted November 28, 2013 Report Share Posted November 28, 2013 Hi, here's my JS code function loadChart(){ $.ajax({ url: (some/json/data/generator), type: "POST", contentType: "application/json; charset=utf-8", dataType : "json", success: function (result) { chart1 = new cfx.Chart(); chart1.getData().setSeries(2); chart1.getAxisY().setMin(500); chart1.getAxisY().setMax(2000); var series1 = chart1.getSeries().getItem(0); var series2 = chart1.getSeries().getItem(1); series1.setGallery(cfx.Gallery.Lines); series2.setGallery(cfx.Gallery.Bar); chart1.setDataSource(result.d); var divHolder = document.getElementById('ChartDiv'); chart1.create(divHolder); }, error: function (xhr, txt, err) { alert("error connecting to data: " + txt); } }); } $(document).ready(function($){loadChart()}); My json result seems fine [{"Bulan":"Januari","Motor":1500,"Onderdil":1234},{"Bulan":"Februari","Motor":1500,"Onderdil":1234},{"Bulan":"Maret","Motor":1500,"Onderdil":1234},{"Bulan":"April","Motor":1500,"Onderdil":1234},{"Bulan":"Mei","Motor":1500,"Onderdil":1234},{"Bulan":"Juni","Motor":1500,"Onderdil":1234},{"Bulan":"Juli","Motor":1500,"Onderdil":1234},{"Bulan":"Agustus","Motor":1500,"Onderdil":1234},{"Bulan":"September","Motor":1500,"Onderdil":1234},{"Bulan":"Oktober","Motor":1500,"Onderdil":1234},{"Bulan":"November","Motor":1500,"Onderdil":1234},{"Bulan":"Desember","Motor":1500,"Onderdil":1234}] And yet not showing, pls help. Thanks in advance Quote Link to comment Share on other sites More sharing options...
Question
shinsengumi
Hi, here's my JS code
My json result seems fine
And yet not showing, pls help. Thanks in advance
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
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.