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     Graph reference line for date-time value or alphanumeric

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Graph reference line for date-time value or alphanumeric
 Login/Join
 
Platinum Member
posted
Has anyone had any luck in creating a reference line (on a graph) for a date-time value or an alpha numeric value?

I've had good success with setting reference lines on the Y axis for numeric values, but haven't had any luck with lines on the X axis for non-numeric values.

For example, if I had a graph based like this:
GRAPH FILE CAR
SUM DEALER_COST
ACROSS CAR


I'd like to be able to set a reference line like this:
setReferenceLine(getX1Axis(),0, 'BMW');


Obviously this example doesn't make much sense, but what I really want to get to is graph some "intraday" prices for the last few days of a market. But I want to set a reference line that divides the days up so it's obvious to the user where one day stops and the next day starts. In my particular example, I've formatted the x axis as alpha fields with a specific format (HMdIa) and want to place specific vertical lines at specific points on that horiztonal axis.



Production: 7.6.6 WF Server  <=>  7.6.6 WF Client  <=>  7.6.6 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2005
Output Types: HTML, Excel, PDF
 
Posts: 230 | Location: Wichita, KS | Registered: May 27, 2005Report This Post
Platinum Member
posted Hide Post
Well, I'm not sure if what I'm asking is possible. A bit of lack of understanding of graphs on my part -- here is some info out of the documentation:

quote:

❏ An O1 (group or category) axis is included in all graph types except bubble, histogram,
and scatter graphs.
❏ An X1 axis is only included in bubble, histogram, and scatter graphs.


Combine that information with:

quote:
Reference line support is implemented for various chart types excluding pie and pie bar.
There can be a total of 3 reference lines for each axis (Y1, Y2, and X1).



...and it appears that I can't do what I want since I'm working with a line graph. Mad
This seems to be because my line graph has an O1 axis, but not an X1.


[rant]
I know the graph documentation is lengthy, but it sure is difficult to find dependencies... *sigh*
[/rant]



Production: 7.6.6 WF Server  <=>  7.6.6 WF Client  <=>  7.6.6 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2005
Output Types: HTML, Excel, PDF
 
Posts: 230 | Location: Wichita, KS | Registered: May 27, 2005Report This Post
Virtuoso
posted Hide Post
This might sound really dumb, but, how about compute a column to be greater then the highest value you will be displaying for all dates. Then change the risorwidth to 1. This will cause the bars to appear as lines.

setFillColor(getSeries(1), new Color(0 0 0)); // make the bars black
setRiserWidth(1); // set the witdth to a single point 


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Platinum Member
posted Hide Post
Hmm, I don't think it's dumb. I definitely see where you're going and am having a little bit of success doing it. Now I just need to get the right time values to correspond with my big (computed) value so the bars only show up at the points that I want them to. Should be a simple computed expression that shows 999 for certain time values and 0 for others -- just need to determine how to compute that for my data...

I'll continue playing and let you know how it turned out. Thanks!!



Production: 7.6.6 WF Server  <=>  7.6.6 WF Client  <=>  7.6.6 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2005
Output Types: HTML, Excel, PDF
 
Posts: 230 | Location: Wichita, KS | Registered: May 27, 2005Report This Post
Platinum Member
posted Hide Post
Okay, I made it work based on dhagen's idea -- and I must say it worked out nicely after I figured out what I wanted.

The general idea is to add a second series on Y2 based on a computed field. Then set the style of Y2 to be bar instead of lines, set the riser width to be 1 so it looks like a vertical line, and in my case I want a red line, but you can obviously color it how you'd like.

I created a define to determine the value of that 2nd series based on the HDIFF function -- such that it will compute the day difference between the current row and the last row. If that difference is 1 day, then the value shows as a vertical red line, if it's the same day as the previous row, then nothing shows up.

Here's my define that compares QUOTE_DATE to the LAST QUOTE_DATE and determines a 'day' difference between the date-time values:
BIG_VAL/D20.2 = HDIFF(QUOTE_DATE, LAST QUOTE_DATE, 'DAY', 'D12.2');


and here is the snippet of code to control the y2 axis the way I want:

setY2ScaleMinAuto(false); --turn off autoscaling
setY2ScaleMaxAuto(false); --turn off autoscaling
setY2ScaleMin(0); --set min to 0
setY2ScaleMax(1); --set max to 1 (since a 1 day difference should span the entire height of the graph)
setY2MajorGridDisplay(false); --turn off gridlines
setY2MinorGridDisplay(false); --turn off gridlines
setY2LabelDisplay(false); --turn off labels
setSeriesType(1,1); --set to bars
setFillColor(getSeries(1), new Color(255 0 0)); --set to red
setRiserWidth(1); --set to width of 1 to appear as a line


Pretty simple concept and it works very well -- thanks dhagen!



Production: 7.6.6 WF Server  <=>  7.6.6 WF Client  <=>  7.6.6 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2005
Output Types: HTML, Excel, PDF
 
Posts: 230 | Location: Wichita, KS | Registered: May 27, 2005Report This Post
Platinum Member
posted Hide Post
Something to note to anyone else that happens upon this -- I've discovered today that the setRiserWidth(1) might cause you problems on smaller graphs (on-screen size). As you make your graph size smaller and smaller, the graph engine will eventually reach a point where it can't graph a riser that small and you actually won't get any bar, even though the data says it should be there. (At least this is my theory)

Easy solution, just increase the width of your riser to the smallest value you're willing to live with and that shows up. In my case I'm sitting at 25 on a fairly small graph -- and it still shows up as a 1 pixel line. The larger your graph, the smaller that width can be (and still be visible).



Production: 7.6.6 WF Server  <=>  7.6.6 WF Client  <=>  7.6.6 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2005
Output Types: HTML, Excel, PDF
 
Posts: 230 | Location: Wichita, KS | Registered: May 27, 2005Report 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     Graph reference line for date-time value or alphanumeric

Copyright © 1996-2020 Information Builders