• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFCHART and currentRow

New Here ,
May 30, 2006 May 30, 2006

Copy link to clipboard

Copied

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.

TOPICS
Advanced techniques

Views

702

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 30, 2006 May 30, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 30, 2006 May 30, 2006

Copy link to clipboard

Copied

Thank you, but I have to have the CurrentRow variable.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 30, 2006 May 30, 2006

Copy link to clipboard

Copied

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 (or two arrays), 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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 30, 2006 May 30, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 30, 2006 May 30, 2006

Copy link to clipboard

Copied

LATEST
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? 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation