Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / May 2006



Tip: Looking for answers? Try searching our database.

CFCHART and currentRow

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GuyPhempoompanitch - 30 May 2006 15:07 GMT
I am referencing a query for CFCHART.  On the URL parameter, I need to pass the
currentRow within the URL for that series.  Here's an example:

<cfchart title="MyTitle" chartwidth="#graphWidth#"
url="xyz.cfm?action=drillDownDeeper&label=#myQuery.CurrentRow#"
pieslicestyle="sliced" showborder="Yes" show3d="Yes">

I can get it to display a row by referencing myQuery.columnName[1], but its
the same for all.  I need this to increment for every row in the query result.

Anyone have an idea on how to do this?  thanks.
Fernis - 30 May 2006 16:05 GMT
There are a couple of dynamic variables, which you can put in the URL.
$ITEMLABEL$ - the label of the item
$VALUE$ - the value of the item.

You could use this:
<cfchart title="MyTitle" chartwidth="#graphWidth#"
url="xyz.cfm?action=drillDownDeeper&label=$ITEMLABEL$" pieslicestyle="sliced"
showborder="Yes" show3d="Yes">

Above, we expect of course that your itemlabels are unique - and judging from
your chart style, they are. Just modify your xyz.cfm to deal with the item
labels instead of the row numbers. Hope this helped.
GuyPhempoompanitch - 30 May 2006 16:09 GMT
Thank you, but I have to have the CurrentRow variable.
Fernis - 30 May 2006 16:30 GMT
In that case, I have an interesting idea, which just might work ... at least if
I add "Well, this might be a longshot, but..." (which always makes all crazy
ideas work in tv series)...

Create a javascript array, containing your currentrows and the item labels in
two "columns".

Then, have a chart like:
<cfchart title="MyTitle" chartwidth="#graphWidth#"
url="javascript:myWickedFunction($ITEMLABEL$)" pieslicestyle="sliced"
showborder="Yes" show3d="Yes">

Third, have your myWickedFunction() search for the item label, returning the
rownumber, and automatically redirecting the current window (or the desired
frame) where you want.
GuyPhempoompanitch - 30 May 2006 16:34 GMT
That is a good idea, although I cannot guarantee that the data for ItemLabel is
unique.  The data as a whole is a mess, so we're forced to pass a unique row
number.

I can access the java class that drives the CFCHART tag, but I cannot locate a
method or command that would give me the current row number.  I'm stumped.

Thanks.
Fernis - 30 May 2006 16:53 GMT
Maybe combining both $ITEMLABEL$ and $VALUE$ in the javascript checking would
ensure an acceptable rate of success, when using approach I last suggested. As
a bonus, your javascript routine could check for duplicate value-itemlabel key
pairs, and warn with an alert, if there the details cannot be drilled down
safely.

There's still another approach I just came up with... if you could present a
number before your item labels in the chart, then you could extract that
rownumber from the label with javascript. Of course it would be irritating if
the number didn't mean anything for the viewer, but what if you returned the
query in the right order so that the numbers would indicate the order - the
largest/lowest value first, etc...? You could use CF's queryAddColumn and
querySetCell to modify your item labels...

Getting weird already? ;-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.