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     [CLOSED] Rotate Y Axis Titles - Horizontal Bar chart

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Rotate Y Axis Titles - Horizontal Bar chart
 Login/Join
 
Platinum Member
posted
The Y axis label in Horizontal Bar chart is printed vertically by default. I tried to rotate it using
 setTextRotation(getO1Title(),2); 

But there are only 90,270 and 45 degree rotations.

Is there a way to print the title horizontally.

WF 8205

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 181 | Registered: October 25, 2017Report This Post
Member
posted Hide Post
Hi,

Can you provide the sample with CAR file.


Thanks


WebFOCUS 7x & 8x

 
Posts: 13 | Location: Toronto, ON, CA. | Registered: June 27, 2013Report This Post
Virtuoso
posted Hide Post
Not clear what you are requesting.
The default label printing is horizontal (reading from left to right) not vertical.
A rotation of 90 or 270 degree "transform" an horizontal to vertical.

ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-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
SUM CAR.BODY.DEALER_COST
BY CAR.COMP.CAR
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET AUTOFIT ON
ON GRAPH SET GRWIDTH 1
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, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
-*-* 90 degrees counter clock from default horizontal display (left to right reading)
-*-* Become vertical reading from bottom to top
-*setTextRotation(getY1Label(),1);
-*-* 270 degrees counter clock from default horizontal display (left to right reading)
-*-* Become vertical reading from top to bottom
-*setTextRotation(getY1Label(),2);
-*-* 45 degrees counter clock from default horizontal display (left to right reading)
-*-* Become angle reading from bottom-left to to top-right
-*setTextRotation(getY1Label(),3);
*GRAPH_JS_FINAL
"pieProperties": {
    "holeSize": "0%"
},
"blaProperties": {
    "orientation": "horizontal"
},
"agnosticSettings": {
    "chartTypeFullName": "Bar_Clustered_Horizontal"
}
*END
ENDSTYLE
END
-RUN

If this doesn't answer you request, please provide a sample code as per NARSA suggested


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
Platinum Member
posted Hide Post
Sorry -My question is about the axis title and not axis labels.

In the FEX which you have added the title "CAR" on Y axis is horizontal. Can this be made vertical.
 
Posts: 181 | Registered: October 25, 2017Report This Post
Master
posted Hide Post
I looked in the docs and couldn't see anything.

You can manipulate the chart after it renders with a little JS.

~~~ DISCLAIMER: This is a total hack ~~~
 
GRAPH FILE ibisamp/car
SUM SALES
BY CAR
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET UNITS PIXELS
ON GRAPH SET HAXIS 770.0
ON GRAPH SET VAXIS 405.0
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/endeflt.sty,$
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis, $
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN NOEVAL
<script>
    window.addEventListener('load', function() {
        const yAxis = document.querySelector('text.yaxis-title')
        const regex = /\brotate\([-0-9]+\)/;
        const str = yAxis.getAttribute('transform');
        const subst = 'rotate(0)';
        const result = str.replace(regex, subst);
        const textLen = Math.ceil(document.querySelector('text.yaxis-title').textLength.baseVal.value)
        yAxis.setAttribute('transform',result);
        yAxis.setAttribute('x',textLen/2);
    });
</script>
-HTMLFORM END
 

😋

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


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Platinum Member
posted Hide Post
Thanks Hallway.
But I need to add the graph in a compound PDF report where the HTMLFORM BEGIN and END gets ignored.
 
Posts: 181 | Registered: October 25, 2017Report This Post
Master
posted Hide Post
Yeah, it wasn't meant as a real solution. I was just having fun.

I would probably submit a ticket and see if they know of a way to do it.


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Master
posted Hide Post
I may have found what you need in the docs: Defining the Position of the Y-Axis or Y2-Axis Title
  
GRAPH FILE ibisamp/car
SUM SALES
BY CAR
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET UNITS PIXELS
ON GRAPH SET HAXIS 770.0
ON GRAPH SET VAXIS 405.0
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/endeflt.sty,$
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis, $
*GRAPH_JS
"yaxis": {
    "title": {
        "visible": true,
        "position": "orthogonal",
        "font": "bold 20px Arial",
        "color": "red"
    },
    "bodyLineStyle": {
        "width": 4,
        "color": "blue"
    }
}
*END
ENDSTYLE
END
-RUN



Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report 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     [CLOSED] Rotate Y Axis Titles - Horizontal Bar chart

Copyright © 1996-2020 Information Builders