DannyR Report post Posted September 23, 2010 First, thanks for FusionCharts. I'm glad I was able to convince my company to make the investment. I'm not sure if you would consider this a bug (I would from a developer's usability standpoint), but this may help some other people who are struggling with the "style" object in the Json data format. Using FusionCharts("id").getJSONData() we can see that the typical style object is structured like this: "styles":[ { "definition":[ { "style":[ { "type":"font", "color":"666666", "name":"CaptionFont", "size":"15" }, { "type":"font", "name":"SubCaptionFont", "bold":"0" } ] } ], "application":[ { "apply":[ { "toobject":"caption", "styles":"CaptionFont" }, { "toobject":"SubCaption", "styles":"SubCaptionFont" } ] } ] } ] However, if you feed this object to the chart using setJSONData() what will happen is the chart will interpret this object as follows [substituting (..) for brevity]: "styles":[ { "definition":[ { "style":[ { "style":[ (..) ] } ] } ], "application":[ { "apply":[ { "apply":[ (..) } ] } ] } ] Note the extra "style" and "apply"! Having observed this, I changed my input object to the following structure: "styles":[ { "definition":[ (..) ], "application":[ (..) ] } ] ... thus eliminating the "style" and "apply" properties altogether and moving the "definition" and "application" arrays up a level. This seems to work just fine. If this is the intended behavior, maybe this could be documented somewhere? Share this post Link to post Share on other sites
FusionCharts Support Report post Posted November 25, 2010 Thanks. Share this post Link to post Share on other sites
DannyR Report post Posted November 29, 2010 My pleasure. Keep up the great work guys! Share this post Link to post Share on other sites
juanpaco Report post Posted December 24, 2010 My pleasure. Keep up the great work guys! Thank you for posting this! The JSON documentation for this whole product is atrocious, and your post here just put an end to about 2 hours of absolute frustration. The JSON data format as listed in the examples seemed a bit too deep, composed of too many layers of arrays. The documentation absolutely needs to be changed to be correct. I was about 5 minutes from abandoning FusionCharts altogether, and I'm looking at recommending the expensive SaaS license to my client. That's a big sale to miss out on. Other problems include no standardization on what needs to be capitalized. Is it "toobject" or "toObject?" When defining a font and choosing a font face, is it "font" or "face?" I've found examples of both. If I'm applying something to the caption, is it "caption," "Caption," or "CAPTION? Share this post Link to post Share on other sites
juanpaco Report post Posted December 24, 2010 It seems like some sort of auto XML -> JSON script was used to generate the JSON documentation. The JSON structure as written very closely resembles the XML structure, even though there is this huge difference. Share this post Link to post Share on other sites