gawallis

[resolved] Can one move charts around the DOM in HTML-Table

Recommended Posts

So I have been playing around with this for a couple of days now and I have been working with the debug adding features as I see fit. Obviously my implementation is probably not the best way for coding them, but I do wish to share them with you. Is this place to do such things? I very close to a full integration to jquery Grid and jquery for fusion charts. I am just working on the labels and extracting them from the div.

 

 

 

Thanks,

 

Graham

 

 

 

One thing I did add is an option to append so you could move the chart where you desired. I tried referencing my desired location in the intial select. see below.

 

$('#myNewPlace').convertToFusionCharts({

   swfPath: "../Charts/",

   type: "MSColumn3D",

   data: "#myHTMLTable",

   dataFormat: "HTMLTable"//,

   //append:'myNewPlace'

});

 

 

 

Here is my version

 

$('#myHTMLTable').convertToFusionCharts({

   swfPath: "../Charts/",

   type: "MSColumn3D",

   data: "#myHTMLTable",

   dataFormat: "HTMLTable",

   append:'myNewPlace'

});

 

 

 

Change convertToFusionCharts in jquery-fusion-charts and add the following if block

 

 

 

if(options.append!='')// added an append location if you want to move your chart

{

   $('#'+options.append).append(context);

}

else{

   // Append division before the table

   o.before(context);

}

 

 

 

Hope this helps.

Share this post


Link to post
Share on other sites

Greetings,

 

 

 

Thanks for your suggestion. Here is our observation of the codes you sent:

 

 

 

convertToFusionCharts function takes your data-source (HTML <table> element) as the selector and creates a chart just before it. It is not meant for moving the FusionCharts element. Furthermore, the convertToFusionCharts function DOES NOT accept "data" and "dataFormat" option parameters.

 

 

 

However, what you have done (or what you want to do) can be achieved by directly using insertFusionCharts or appendFusionCharts or prependFusionCharts function.

 

 

 

See example:

 

 

 

$('#myDivToCreateFusionCharts').appendFusionCharts({

   swfPath: "../Charts/",

   type: "MSColumn3D",

   data: "#myHTMLTable",

   dataFormat: "HTMLTable"

});

Share this post


Link to post
Share on other sites

The reason i pass in data and dataFormat was because I was just editing the HTML chart example. Maybe you should consider updating the example next release? I also must have misread the docs it felt like the only method for HTML was the convert method.

 

 

 

Thanks for the help,

 

Graham

 

 

 

convertToFusionCharts function takes your data-source (HTML

 

Edited by Guest

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