0

I'm using a coldfusion AJAX call to bind a div containing query results populated based on options in another div. In the DIV being called with AJAX, I have a CFLAYOUT tag creating several tabs.

In one tab, I have a Coldfusion CFCHART element that creates a nice graph. I want the graph to re-size based on the dimensions of the tab DIV it is inside of.

It seems the CFCHART tag accepts pixel dimensions for height and width, and that I need to be able to dynamically resize the chart based on the dimensions of the browser window. I'd prefer the object to remain in flash but I can change it to a JPEG or PNG if needed.

How would I easily get these dimensions and change them with Javascript? is there another easy method? What would I do on a window resize?

Brad Hines
  • 107
  • 2
  • 15

1 Answers1

0

You're not going to be able to achieve this dynamically using cfchart. Coldfusion generates all of the code and compiles it into a SWF, or image based on the parameters you had set when the page loaded.

Your best bet is to find a good jquery graph plugin, on a quick search I found this one that looks similar to cfchart - http://www.jqplot.com/

You might also want to look into CSS3 and HTML5, you can do a lot now without the use of Javascript, or cfCharts.

http://csswizardry.com/2010/02/css-bar-charts-styling-data-with-css3-and-progressive-enhancement/

TheJason
  • 494
  • 6
  • 18
  • I've looked into the charting options offered by various Jquery solutions. I've found that outputting the JS is a bit of a challenge and the debugging is spotty with most Jquery and Google implementations. It would be nice if the chart object could be contained in a div and re-sized easily. – Brad Hines May 08 '12 at 16:32