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     [SOLVED] Horizontal Stacked Bar Data Text Position

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Horizontal Stacked Bar Data Text Position
 Login/Join
 
Expert
posted
The setDataTextPosition(#) sets the position of the values used in a stacked bar chart, 5:top/left and 2: above/right, for all series. However, I need to be able too see all the values of the bars. NOTE that the HIVAL for Italy is only visible if I change setScaleMax(getY1Axis(),975.0); to 990 [975 is the max of HIVALs]. The LOVAL for Japan is not visible. Here's the code (Using the CAR file):
ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE CAR
-* Created by Info Assist for Graph
SUM COMPUTE LOVAL/I6%=DECODE COUNTRY ( 'ENGLAND' 975 'ITALY' 960 'FRANCE' 488 'JAPAN' 13 'W GERMANY' 36 ) ;
COMPUTE HIVAL/I6%=975 - LOVAL ;
BY CAR.ORIGIN.COUNTRY AS ''
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET AUTOFIT ON
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis, $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDataTextPosition(5);
setDataTextDisplay(true);
setPieFeelerTextDisplay(1);
setFontName(getDataText(),"ARIAL");
setFontSizeAbsolute(getDataText(),true);
setAutofit(getDataText(),false);
setFontSizeInPoints(getDataText(),18);
setPlaceResize(getDataText(),0);
setScaleMinAuto(getY1Axis(),false);
setScaleMaxAuto(getY1Axis(),false);
setGridStepAuto(getY1MajorGrid(),false);
setDisplay(getLegendArea(),false);
setDisplay(getY1Label(),false);
setScaleMax(getY1Axis(),975.0);
*GRAPH_JS_FINAL
"pieProperties": {
    "holeSize": "0%"
},
"blaProperties": {
    "seriesLayout": "stacked",
    "orientation": "horizontal"
},
"agnosticSettings": {
    "chartTypeFullName": "Bar_Stacked_Horizontal"
}
*END
ENDSTYLE
END
-RUN

-*IA_GRAPH_FINISH

This message has been edited. Last edited by: Doug,




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
Doug,

Please delete the first 5 lines of code, which we do not need to see 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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Not much you can do with this (I think).

Use developer tools to view what is created and you'll see that these data labels are not even created within the output.

You might be able to force these elements using JavaScript yourself, but that might be tricky.

If you can see the HIVAL text when pushing the maximum axis value to 990, what about forcing the minimum axis value to be negative?

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
quote:
Please delete the first 5 lines of code, which we do not need to see Smiler

But it said "Do not delete or modify the comments Smiler

quote:
Use developer tools to view what is created and you'll see that these data labels are not even created within the output.

They're just displayed, or not, with options under Series / Data Labels. So I played around with that. But, it's for all series and, imho, should be series selectable. But, then again, if the values need to with within the bar segment, that won't do either. So perplexing ...

quote:
what about forcing the minimum axis value to be negative?

I did think of that... But, it doesn't work as it's still "right justified" and doesn't fit within the actual bar / value series. Frowner

quote:
You might be able to force these elements using JavaScript yourself, but that might be tricky.

I'm not sure how tricky I want to get on this. The values do show when you hoover over the bars, narrow or wide.

This message has been edited. Last edited by: Doug,
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
I think that the issue is less related to the scaling then the font used for the data label AND the window's size.

By using a smallest font, the data label are seen in a much smaller window.
setFontSizeInPoints(getDataText(),8);

Instead of
setFontSizeInPoints(getDataText(),18);


The window size have a great impact on label visibility and playing with the size, the labels are shown or not.
But a font at 18, may be too large...


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
I considered using setFontSizeInPoints(getDataText(),8);, but, this needs to be display on a laptop with a 1366x768 display, making 8 pt too small for the user Frowner. Thanks anyway Smiler.

Actually, that does work for "COUNTRY", but, I neglected to add that my bar titles are A48, such as "856 Received < Partial Shipment : 013"

To see this, change the following sections of the code as follows:
...
...
DEFINE FILE CAR
MyTitle/A38=DECODE COUNTRY ( 'ENGLAND' 'Item 1 for England with more info: 013' 'ITALY' 'Italy 67890123456789012345678901234567' 'FRANCE' 'France 7890123456789012345678901234567' 'JAPAN' 'Japan 67890123456789012345678901234567' 'W GERMANY' 'W Germany 0123456789012345678901234567' ) ;
END
GRAPH FILE CAR
-* Created by Info Assist for Graph
SUM
COMPUTE LOVAL/I6%=DECODE COUNTRY ( 'ENGLAND' 975 'ITALY' 960 'FRANCE' 488 'JAPAN' 10 'W GERMANY' 36 ) ;
COMPUTE HIVAL/I6%=975 - LOVAL ;
BY MyTitle AS ''
BY COUNTRY NOPRINT
...
-* Add COLUMN=N4 to the BUCKET list
TYPE=DATA, COLUMN=N4, BUCKET=y-axis, $
...
-* Change the following line to variaous numbers:
setFontSizeInPoints(getDataText(),6);
...

This message has been edited. Last edited by: Doug,
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
quote:
I considered using setFontSizeInPoints(getDataText(),8);, but, this needs to be display on a laptop with a 1366x768 display, making 8 pt too small for the user


Not to challenge you Doug, I know that sometime users may be picky, but at least getDataText(),10) is not that bad. I have a 1920x1080 laptop and it's farely readable. At 1366x768 it is even bigger.
Do you also plan to change the axis font to 18 because actually, you kept them as the default 10 ?

Personally, I don't know how it could be possible to manage every single screen resolution. Even with a default recommended screen resolution, a user can decide to change it to a lowest one.
So, normally I build a default format suitable for most of the screens then unfortunately nothing more I can do .

No matter the font size you will use, when resizing the output window, some data will be hidden...

This message has been edited. Last edited by: MartinY,


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
Thanks Martin, I totally agree. I'm not challenged or offended by your comments at all. "We" just decided to accommodate the 1366x768 as our standard with the caveat that "It may not be a perfect fit for other screen resolutions.". We have not even considered tablets or smart phones yet.

I am going to present the font size of 6 for not and hope that they can live with it considering that they can hoover over the bars, as long as the are GT 0, to see the actual values.

Thanks again Tony and Martin Smiler




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 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     [SOLVED] Horizontal Stacked Bar Data Text Position

Copyright © 1996-2020 Information Builders