Focal Point
Stacked Bar Graph with UNStacked Lines??

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3281002532

July 02, 2007, 05:27 PM
Trav
Stacked Bar Graph with UNStacked Lines??
Logged a case today, but was hoping someone might have figured this one out...

We're building a stacked bar graph that also has some series that are plotted as lines. However, we want the lines to NOT be stacked. I can't figure out a way to tell WebFOCUS to do this -- it always wants to stack the lines even though it does appear to treat the bars and lines as their own stacks...

The only idea I have at the moment is to "adjust" the values of the series that are lines to be the difference between the current series and the previous series. Then it would essentially "counteract" the stacking and plot them where they should be. This sounds pretty painful, so I'm hoping someone else has a great idea that I haven't thought of yet.

Think it's possible to plot 2 different graphs (with transparent backgrounds) and stack the images on top of each other?



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
July 03, 2007, 02:55 AM
Tony A
Trav,

The way that I do this is to use a dual axis stacked bar chart - setGraphType(20); and then assign the data ranges to either the left or right axis changing the plot type as required -
ON GRAPH SET GRAPHSTYLE *
-* Graphtype is Vertical Dual-Axis Stacked Bars
setGraphType(20);
setAxisAssignment(0,1);
setSeriesType(0,1);
setAxisAssignment(1,1);
setSeriesType(1,1);
setAxisAssignment(2,0);
setSeriesType(2,2);

An additional item that I use is a calculation of what data range is the highest, round that up to the next 100 and then set the max for each vertical axis to that value.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
July 03, 2007, 09:06 AM
Trav
Tony, I had tried that and unfortunately it still stacks the lines too. If I only have one line, then it works just fine, but as soon as you start adding more series plotted as lines, it starts stacking them. In my case I have 4 series that are plotted as stacked bars and 6+ series plotted as lines...

Unless I missed something in your method?



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
July 03, 2007, 09:08 AM
Trav
Also, for what it's worth, my theory on adjusting the values to be the difference between series didn't work because it stacks negative values below zero and positives above zero...



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
July 03, 2007, 09:16 AM
mgrackin
Trav,

I do not have WF 7.6 but I THINK I remember hearing this particular issue discussed at Summit 1 or 2 years ago and that it was going to be added to the abilities of the graph engine. Unfortunately I do not have a WF 7.6 install to experiment with to see if it IS in the product. May be the GRAPH gurus at IBI can answer this one.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
July 03, 2007, 09:17 AM
Tony A
Trav,

No, it was me who missed your requirements! Frowner

As you will see from my post I only have three data series, two bars and one line. Works fine with that, but not for your situation.

I think that you have already identified the only solution - by realignment of the data series values - the downside of this is the mouseover popups with the series values will be incorrect so it would be best to turn them off. Of course, your users are bound to want them back!!!

Instead of realigning the line series data, how about just have a clustered bar chart and messing with the width of the bars and the overlap? Might work ...

Good luck

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
July 03, 2007, 09:28 AM
Trav
I messed with 7.6.1 but didn't have any luck there either.

I think I've basically realized that I'm going to have to have Excel do the graph. IBI will probably love that, but that's how it goes I guess...



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
July 03, 2007, 12:00 PM
Trav
Oh, I wish they were always this simple...

setForceSeriesAbsolute(getSeries(0),true);


Got this back from techsupport on our open case. This is an UNDOCUMENTED function/property. I searched through the 1396 page graphics document and it is NOT there. DocServices, are you listening? Smiler

Apparently it IS in the new features document for 713 though. Frowner

Anyway, now that I know the function call, if I search on techsupport, I can find plenty of results and the answers that I need. Oddly enough though, until I knew the function name, I wasn't able to find anything with the various searches I tried. Almost too obvious now that I see the search results...

*frustrated but pleased*



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
July 03, 2007, 02:26 PM
Tony A
Trav,

Thanks for feeding back on this very useful setting Smiler

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 22, 2008, 05:09 PM
Doug
Thanks Trav for posting this issue AND for posting the solution. The only thing I'll add to this that the line needs to be added for each of the series used in the graph and that the "0" needs to be changed to match the associated series.

setForceSeriesAbsolute(getSeries(0),true);

Thanks again. I was going to go to Tech Support for the answer and found it here in the WebFOCUS World instead.

-Doug




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206