Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Help needed with graph api

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Help needed with graph api
 Login/Join
 
<Kalyan>
posted
Hello,
I am facing some problems in using graph api.The code is given below :

REMOTE DEST=TEST
-REMOTE BEGIN
SET GRAPHEDIT =SERVER
SQL SQLDBC
SELECT SUM(D.AMOUNT) AS AMOUNT,((CURRENT_DATE-D.BIL_DT) -C.TERMS)
AS DPT FROM
MYTABLE1,MYTABLE2,MYTABLE3

WHERE CONDITION1 AND CONDITION2 AND CONDITION3 AND
DPT >= '&START_DAY' AND DPT < ('&START_DAY'+10)
GROUP BY DPT;
TABLE HOLD AS HOLD1
END
GRAPH FILE HOLD1
PRINT
AMOUNT AS 'Dollars'
ACROSS DPT AS 'Days'

ON GRAPH SET LOOKGRAPH 3DBAR
ON GRAPH SET GRAPHSTYLE *
setURL(0,0,"JAVASCRIPT:fnload(&START_DAY);");
setURL(0,1,"JAVASCRIPT:fnload(&START_DAY+1);");
setURL(0,2,"JAVASCRIPT:fnload(&START_DAY+2);");
setURL(0,3,"JAVASCRIPT:fnload(&START_DAY+3);");
setURL(0,4,"JAVASCRIPT:fnload(&START_DAY+4);");
setURL(0,5,"JAVASCRIPT:fnload(&START_DAY+5);");
setURL(0,6,"JAVASCRIPT:fnload(&START_DAY+6);");
setURL(0,7,"JAVASCRIPT:fnload(&START_DAY+7);");
setURL(0,8,"JAVASCRIPT:fnload(&START_DAY+8);");
setURL(0,9,"JAVASCRIPT:fnload(&START_DAY+9);");
setURL(0,10,"JAVASCRIPT:fnload(&START_DAY+10);");
ENDSTYLE
END
-REMOTE END
-HTMLFORM BEGIN
HTML

BODY

script
function fnload(str)
{
alert(str);
}
script

BODY

HTML
-HTMLFORM END

**********************************
Now my problem: Suppose &START_DAY=25. The graph works fine if there is data retrieved for START_DAY=25,26,27.28 and so on. .But incase of there being no data for START_DAY=25 and data is retrived for START_DAY=27 onwards then everything goes for a toss.. The first bar when clicked alerts "25" though x axis value shows a value 27 !!

I want the value 27 to be passed to the java script.. How do I do it??


Thanks,
Kalyan
 
Report This Post
Gold member
posted Hide Post
The best bet would be to take the new Start date from the table call.

Something like:

TABLE FILE HOLD
SUM ...
BY DPT
*(which is the start_day I'm guessing)*
ON TABLE HOLD FORMAT ALPHA
END
-RUN
-READ HOLD &NEW_FIRST_DAY.I2.
-RUN

*(Assuming the value is a 2 digit number)*

Then using &NEW_FIRST_DAY as the start value for the graph API calls.


Leo
 
Posts: 96 | Location: Winnipeg, Manitoba, Canada | Registered: January 22, 2004Report This Post
<Grzegorz>
posted
Isn't it sufficient to use WebFOCUS stylesheets instead of TDG API in this case ?


-* ...
ON GRAPH SET STYLE *
TYPE=DATA, JAVASCRIPT=fnload( DPT ),$
ENDSTYLE
-*...


Regards
Grzegorz
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Help needed with graph api

Copyright © 1996-2020 Information Builders