Sign in to follow this  
OliM

Javascript + Json Drill Down Issue

Recommended Posts

Hello,

 

I created a pie chart rendered in javascript and using a json object as data source and having links (using the newchart-json-id structure), the chart displays fine on load, but when I click on the sections, the links show me a No data to display message.

 

Here is my json object structure :

 

 

{

"chart": {

"caption": "",

"subcaption": "",

"manageLabelOverflow": "1",

"xAxisName": "Week",

"yAxisName": "Sales",

"numberPrefix": "$",

"showBorder": "0",

"bgAlpha": "0,0",

"pieRadius": "100",

"enableRotation": "1",

"showpercentvalues": "1"

},

"linkeddata": [{

"id": "Alimentation",

"linkedcharts": {

"chart": {

"caption": "",

"subcaption": "",

"manageLabelOverflow": "1",

"xAxisName": "Week",

"yAxisName": "Sales",

"numberPrefix": "$",

"showBorder": "0",

"bgAlpha": "0,0",

"pieRadius": "100",

"enableRotation": "1",

"showpercentvalues": "1"

},

"data": [{

"value": 4161.3,

"label": "Restaurants"

}, {

"value": 42.8,

"label": "Boissons Alcoolisees"

}, {

"value": 0,

"label": "epicerie"

}]

}

}, {

"id": "Animaux",

"linkedcharts": {

"chart": {

"caption": "",

"subcaption": "",

"manageLabelOverflow": "1",

"xAxisName": "Week",

"yAxisName": "Sales",

"numberPrefix": "$",

"showBorder": "0",

"bgAlpha": "0,0",

"pieRadius": "100",

"enableRotation": "1",

"showpercentvalues": "1"

},

"data": [{

"value": 0,

"label": "Nourriture"

}, {

"value": 0,

"label": "Ponzu"

}, {

"value": 119.69999999999999,

"label": "Konbu"

}, {

"value": 0,

"label": "Katsuo"

}]

}

}],

"data": [{

"value": 4764.3,

"label": "Alimentation",

"link": "newchart-json-Alimentation"

}, {

"value": 119.69999999999999,

"label": "Animaux",

"link": "newchart-json-Animaux"

}]

}

 

Is there anything amiss in my object or maybe it could be because I'm using the free version for now?

 

Thank you!

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

Please note that linkedcharts does not specify the child JSON data, the proper attribute for the same is Linkedchart which contains Linkedchart data.

 

More details at: http://docs.fusioncharts.com/charts/?DataFormats/JSON/LinkedCharts.html

 

Please find the modified code below:

 

{
"chart": {
"caption": "",
"subcaption": "",
"manageLabelOverflow": "1",
"xAxisName": "Week",
"yAxisName": "Sales",
"numberPrefix": "$",
"showBorder": "0",
"bgAlpha": "0,0",
"pieRadius": "100",
"enableRotation": "0",
"showpercentvalues": "1"
},
"linkeddata": [{
"id": "Alimentation",
"Linkedchart": {
"chart": {
"caption": "",
"subcaption": "",
"manageLabelOverflow": "1",
"xAxisName": "Week",
"yAxisName": "Sales",
"numberPrefix": "$",
"showBorder": "0",
"bgAlpha": "0,0",
"pieRadius": "100",
"enableRotation": "0",
"showpercentvalues": "1"
},
"data": [{
"value": 4161.3,
"label": "Restaurants"
}, {
"value": 42.8,
"label": "Boissons Alcoolisees"
}, {
"value": 0,
"label": "epicerie"
}]
}
}, {
"id": "Animaux",
"Linkedchart": {
"chart": {
"caption": "",
"subcaption": "",
"manageLabelOverflow": "1",
"xAxisName": "Week",
"yAxisName": "Sales",
"numberPrefix": "$",
"showBorder": "0",
"bgAlpha": "0,0",
"pieRadius": "100",
"enableRotation": "1",
"showpercentvalues": "1"
},
"data": [{
"value": 0,
"label": "Nourriture"
}, {
"value": 0,
"label": "Ponzu"
}, {
"value": 119.69999999999999,
"label": "Konbu"
}, {
"value": 0,
"label": "Katsuo"
}]
}
}],
"data": [{
"value": 4764.3,
"label": "Alimentation",
"link": "newchart-json-Alimentation"
}, {
"value": 119.69999999999999,
"label": "Animaux",
"link": "newchart-json-Animaux"
}]
}

 

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hi,

 

I believe the confusion comes from a wrong sample provided on http://docs.fusioncharts.com/charts/contents/JavaScript/JS_LinkedCharts.html under "LinkedChart sample with descendant data embedded in parent data (data string method)". It sates "linkedcharts" instead of "linkedchart". Please correct it.

 

Thanks.

 

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

Please note that linkedcharts does not specify the child JSON data, the proper attribute for the same is Linkedchart which contains Linkedchart data.

 

More details at: http://docs.fusionch...nkedCharts.html

 

Please find the modified code below:

 

{
"chart": {
"caption": "",
"subcaption": "",
"manageLabelOverflow": "1",
"xAxisName": "Week",
"yAxisName": "Sales",
"numberPrefix": "{:content:}quot;,
"showBorder": "0",
"bgAlpha": "0,0",
"pieRadius": "100",
"enableRotation": "0",
"showpercentvalues": "1"
},
"linkeddata": [{
"id": "Alimentation",
"Linkedchart": {
"chart": {
"caption": "",
"subcaption": "",
"manageLabelOverflow": "1",
"xAxisName": "Week",
"yAxisName": "Sales",
"numberPrefix": "{:content:}quot;,
"showBorder": "0",
"bgAlpha": "0,0",
"pieRadius": "100",
"enableRotation": "0",
"showpercentvalues": "1"
},
"data": [{
"value": 4161.3,
"label": "Restaurants"
}, {
"value": 42.8,
"label": "Boissons Alcoolisees"
}, {
"value": 0,
"label": "epicerie"
}]
}
}, {
"id": "Animaux",
"Linkedchart": {
"chart": {
"caption": "",
"subcaption": "",
"manageLabelOverflow": "1",
"xAxisName": "Week",
"yAxisName": "Sales",
"numberPrefix": "{:content:}quot;,
"showBorder": "0",
"bgAlpha": "0,0",
"pieRadius": "100",
"enableRotation": "1",
"showpercentvalues": "1"
},
"data": [{
"value": 0,
"label": "Nourriture"
}, {
"value": 0,
"label": "Ponzu"
}, {
"value": 119.69999999999999,
"label": "Konbu"
}, {
"value": 0,
"label": "Katsuo"
}]
}
}],
"data": [{
"value": 4764.3,
"label": "Alimentation",
"link": "newchart-json-Alimentation"
}, {
"value": 119.69999999999999,
"label": "Animaux",
"link": "newchart-json-Animaux"
}]
}

 

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hi,

 

I believe the confusion comes from a wrong sample provided on http://docs.fusioncharts.com/charts/contents/JavaScript/JS_LinkedCharts.html under "LinkedChart sample with descendant data embedded in parent data (data string method)". It sates "linkedcharts" instead of "linkedchart". Please correct it.

 

Thanks.

 

Hi IMK,

 

Thanks for pointing this out. We will correct this in a short while.

 

Thanks again.

Share this post


Link to post
Share on other sites

it's still not fixed in examples, took me a while to find it in here, can you please fix it ?

 

also is there an explanation when and how to use to use linkedchart/linkedcharts ? what's the difference ?

 

thanks

 

Hi IMK,

 

Thanks for pointing this out. We will correct this in a short while.

 

Thanks again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this