Problem with parse json and rendering

Hi,

I try to initiate a chart object like this:


var pieRevenueChart= new dhtmlXChart(
{ 'view':'bar',
 'value':'#yearsales#',
 'container':'pieRevenueChart',
 'label':'#bike#',
 'radius':0,
 'preset':'alpha',
 'xAxis':{'template':'#bike#'},
 'yAxis':{'title':'Sales per Bike'}});

pieRevenueChart.load("/planlogiq/index.php/CustomerAction/ajaxJSONpiechartbikes?period_id=1&fact_id=-1","json");

the json looks like this:

[{"id":"1936","yearsales":"50000.00","bike":"CVO"},
{"id":"2011","yearsales":"24400.00","bike":"Dyna"},
{"id":"2086","yearsales":"15400.00","bike":"Sportster"},
{"id":"2161","yearsales":"31000.00","bike":"V-Rod"},
{"id":"2236","yearsales":"38000.00","bike":"Touring"},
{"id":"2311","yearsales":"33000.00","bike":"Softtail"}]

With the first load, the chart displays no values. On a manual refresh, I see labels in the upper left of the chart div on a third refresh, i see the chart without bars:(

Pls. can you help me with this issue? Thanks!



Can’t reproduce the issue.
See the attached demo
12.12.20.rar (379 KB)

Ok, I see your code is working, but in my page, i recieve the following js error message:

The “coords”-Attribut of -Tags has not the correct format “left,top,right,bottom”.
coords=“40,-12,23,-39.5”

I would really love to see my chart looking like the one you send in your zip file! :wink:

Please, provide us completed demop to test it
docs.dhtmlx.com/doku.php?id=othe … leted_demo

Hi, Thanks for your help, I found out the problem:( And good for you! Bad for me;) It’s due to some behaviour of some bootstrap css I use… As I embedded it into a tab, the css isn’t recogniced correctly -> I made a quick and dirty walk around, by putting the charts to the “active” tab, then they are rendered correctly. If they are put on the “not active” ones, they are rendered, but without colors…

Thank you and wish you a nice x-mas!

You too :slight_smile: