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     WF Graph - X-axis label getting cropped in graph

Read-Only Read-Only Topic
Go
Search
Notify
Tools
WF Graph - X-axis label getting cropped in graph
 Login/Join
 
Expert
posted
The x-axis labels get cropped, particularly when rotated 90 degrees.

I get this problem very often and other than changing the font-size, I haven't found a definitive solution.

Setting the graph frame size makes no difference.

I always thought this sets the graph frame to the max:

setRect(getFrame(), new Rectangle(-16000,-16000,32000,32000)); // Set the graph display area to be the entire canvas

Why does this problem occur? And how do I definitively solve it? Is there no way to specify space for the x-axis labels, something using setRect?

Thanks,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Well, it looks like this works - reducing the margin:
// Define the margin to draw around the entire chart. The default value is (-15500, -15500, 31000, 31000)
// this solves the problem with x-axis label cropping
setPlaceMargin(new Rectangle (-15500, -14500, 32000, 30000));
For some annoying reason, disabling the Legend requires increasing/reducing??? the margin even further:
// Define the margin to draw around the entire chart. The default value is (-15500, -15500, 31000, 31000) 
// this solves the problem with x-axis label cropping
setPlaceMargin(new Rectangle (-15500, -13700, 32000, 30000)); 


I have never understood the Cartesian Coordinate System:
quote:
To plot a point in the Cartesian Coordinate System, you must provide at least two coordinates
(X,Y). In WebFOCUS Graphics, four coordinates are required to plot a rectangle such as the
Frame Rectangle or Legend Rectangle—X, Y, Width, and Height. The first two coordinates
(X,Y) control the point location of the bottom left corner of the rectangle, while the last two
coordinates control the width and height of the rectangle.

How this works with the graph margin I don't know, I also don't know what the graph margin is and including/excluding the graph legend affects the x-axis labels.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
I don't suppose you're unclear that Rectangles are defined as this?:
new Rectangle(X, Y, WIDTH, HEIGHT);


I have no idea where you found that scrap of documentation, but if that's all of it it's omitting to mention anything about the units used in that coordinate system, where the origin is located relative to the GRAPH drawing area or in what directions those coordinates go.

I suspect that the origin is actually located at the top-left corner of the GRAPH, with the X-axis pointing to the right (as usual) and the Y-axis pointing down (not so usual). This is a common axis definition on computer screens and in printing.

As for the scale - I have no idea. Points would make some sense, but I don't think that's what we're looking at here:

Computer screens are generally defined as 72 dpi, meaning 1 inch would cover 72 points. With a width and height of 32000 and 30000 respectively, that would make a rather large GRAPH. I don't think I'd like a display capable of displaying that.

But even if you'd consider measuring the GRAPH as if it were to be printed on paper, in printing, resolution on paper is generally defined as 300 dpi - that would still measure a GRAPH of over 100" wide. I'm sure management would love to see there graphs as billboards, but that does seem a bit over the top...


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
Francis,

Check out the documentation here and click on the link for "How Does WebFOCUS Graphics Use the Virtual Coordinate System?"

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
Virtuoso
posted Hide Post
To summarize that lengthy document:

  • GRAPHs use a virtual coordinate system
  • The dimensions of the GRAPH in this virtual coordinate system are ALWAYS 32000x32000 "units", regardless of the dimensions of the actual GRAPH area or the specified unit for those dimensions.
  • The direction of the X-axis is from left to right.
  • The direction of the Y-axis is from bottom to top.
  • The origin O (0,0) is at the CENTER of the virtual coordinate system.


Hence, the corners of the GRAPH are at coordinates:
(-16000, -16000) for top-left,
(16000, -16000) for top-right,
(16000, 16000) for bottom-right and
(-16000, 16000) for bottom-left.

A consequence of this virtual coordinate system is that the size of GRAPH elements, expressed in "virtual units", scales with the size of the GRAPH area.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
I'm too old for this virtual world. I like concrete.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
So, there is a great explanation regarding the virtual coordinate system. That doesn't explain why excluding the legend from a graph causes the rotated x-axis labels to get cut off, and why reducing (or increasing - I don't know which I'm actually doing) the margin solves the problem.

Cheers, thanks a lot.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 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     WF Graph - X-axis label getting cropped in graph

Copyright © 1996-2020 Information Builders