Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drawing a CHART using EXCEL COM Object

Status
Not open for further replies.

Leon1977

IS-IT--Management
Jun 27, 2001
79
BG
Hi I am using Cold Fusion 4.5 and I want to draw a line chart. So i've decided to do this using Excel COM object
I tried several aproaches but no result
Any help (code) will be more than helpfull
Thanx in advance
 
You can go to for info on how to do this.

Also, there is a barchart tag for 4.5 on the macromedia.com developer exchange. Of course, with Excel COM, you must have Excel on your server and it will have problems if the COM object is instantiated numerous times (concurrently), so I would steer towards the "bargraph.cfm" tag.
 
How many servers do you know that have Excel installed?? ;-)

Hope it helps,
-Carl
 
ok but I need Line chart
maybe some other approach(not using excel com object)
any idea???
 
A line chart is going to be tough, I think. How many points on the line are we talking about? Is it a true line chart? Or a scatter graph with a median?

If it's a true line chart, you could probably present the same data in a vertical bar chart. It wouldn't be exactly what you want, but it would convey the same info, and it would certainly save yourself a LOT of trouble.
Hope it helps,
-Carl
 
It should be dynimacly created over a database query results
 
If a vertical bar chart would work for you, that's pretty easy to accomplish:

Code:
<CFQUERY name=&quot;chartdata&quot; ...>
  SELECT ...
</CFQUERY>

<cfset oneunit = 10>

<table border=&quot;0&quot; cellspacing=&quot;4&quot;>
<tr>
<CFOUTPUT query=&quot;chartdata&quot;>
<cfset barHeight = Ceiling(chartdata.columnwhatever * oneunit)>
<td valign=&quot;bottom&quot;><IMG SRC=&quot;chartbar.gif&quot; width=&quot;#oneunit#&quot; height=&quot;#barHeight#&quot; border=&quot;0&quot; alt=&quot;#chartdata.columnwhatever#&quot; /></td>
</CFOUTPUT>
</tr>
</table>

you'll see how similar it actually looks to a line chart.

If you really need a line chart, you're going to either have to find a component that can draw GIFs or PNGs dynamically, or use Flash (<-- an interesting option... though a bit trickier to accomplish in v4.5 than it would be in MX).
Hope it helps,
-Carl
 
Leon,
Found this a little late... but it looks like a nice little package (looks like it's a servlet and maybe an applet pair), and it'll do line charts (as well as many others)


but it'll output in Flash, GIF, even PDF.

Thought I'd throw that in there.

Hope it helps,
-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top