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] Change order of the X Axis for a Bar Chart

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Change order of the X Axis for a Bar Chart
 Login/Join
 
Platinum Member
posted
Hi all,

Starting to make my first ventures into Graphs and have got stuck quite quickly!

I have a simple table that contains summarised data with the following fields with one record per day of the week:

DAY (Eg MON, TUE, WED,...)
DAY_NO (Eg 1,2,3,...)
ORDERED

For my Bar Chart I was hoping to have the days of the week on the X Axis with the Order Qty on the Y Axis. However if I use the field DAY the chart orders the columns alphabetically, so the columns are in the order FRI, MON, SAT, THU etc.

I was hoping I could set my sort by DAY_NO by DAY and make DAY_NO NOPRINT but I am not having any success.

GRAPH FILE SQLOUT
PRINT SQLOUT.SQLOUT.ORDERED
ACROSS SQLOUT.SQLOUT.DAY 
ON GRAPH SET LOOKGRAPH VBRSTK1
ON GRAPH SET 3D ON
ON GRAPH SET BARNUMB OFF
ON GRAPH SET GRID ON
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET VZERO ON
ON GRAPH SET GRAPHSTYLE *
setSeriesType($0,1);
setSeriesType($1,1);
setSeriesType($2,1);
setLegendDisplay(true);
setLegendMarkerPosition(0);
setMarkerDisplay(true);
setUseSeriesShapes(false);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setY1LabelDisplay(true);
setY1AxisSide(0);
setTextFormatPreset(getY1Label(),1);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setFontSize(getO1Label(),12);
setFontSizeAbsolute(getO1Label(),true);
setPlace(true);
ENDSTYLE
END


Any ideas?

Many thanks

Mark

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


WebFocus 765. iSeries v5r4
 
Posts: 175 | Location: England | Registered: April 11, 2006Report This Post
Expert
posted Hide Post
Mark,

What is the format of your Day field? Is it internal date format, something like Dt? If not, then try that as it should order it the way you need.

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
I don't see how using your DAY_NO column would not work??? Probably because you are using PRINT instead of SUM:

GRAPH FILE SQLOUT
SUM
SQLOUT.SQLOUT.ORDERED
ACROSS SQLOUT.SQLOUT.DAY_NO NOPRINT
ACROSS SQLOUT.SQLOUT.DAY

This would work also:
DEFINE FILE SQLOUT
  DAY_NUMB/I2 = DECODE DAY (
       'MON' 1
       'TUE' 2
       'WED' 3
       'THU' 4
       'FRI' 5
       'SAT' 6
   ELSE 7);
END
GRAPH FILE SQLOUT
SUM
  SQLOUT.SQLOUT.ORDERED

ACROSS DAY_NUMB NOPRINT
ACROSS SQLOUT.SQLOUT.DAY 



You should SUM not PRINT...

hth

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
Hi Tom,

Thanks, I have changed my PRINT to SUM but the DAYNO field that I have set to NOPRINT is still appearing on the X Axis and the DAYS label is not showing at all.

I should add that I am currently working on a Webquery project (cut down version of WebFocus), however I would still expect this to work??


WebFocus 765. iSeries v5r4
 
Posts: 175 | Location: England | Registered: April 11, 2006Report This Post
Expert
posted Hide Post
Hi Mark,

Try this:

GRAPH FILE SQLOUT
SUM
SQLOUT.SQLOUT.ORDERED
BY SQLOUT.SQLOUT.DAY_NO NOPRINT
BY SQLOUT.SQLOUT.DAY


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
Mark, this works.

I added ON GRAPH SET GRMERGE ON to your style code...
  
APP PREPENDPATH ODS_FINANCE IBISAMP
-RUN
DEFINE FILE GGSALES
  DAY_ENG/A4 = DOWK(DATE, 'A4');
  DAY_NUM/I2 = DECODE DAY_ENG (
       'MON' 1
       'TUE' 2
       'WED' 3
       'THU' 4
       'FRI' 5
       'SAT' 6
   ELSE 7);
END
GRAPH FILE GGSALES
SUM
    DOLLARS/P12.2MC
  BY DAY_NUM NOPRINT
  BY DAY_ENG
ON GRAPH SET LOOKGRAPH VBRSTK1
ON GRAPH SET 3D ON
ON GRAPH SET GRMERGE ON 
ON GRAPH SET BARNUMB OFF
ON GRAPH SET GRID ON
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET VZERO ON
ON GRAPH SET GRAPHSTYLE *
setSeriesType($0,1);
setSeriesType($1,1);
setSeriesType($2,1);
setLegendDisplay(true);
setLegendMarkerPosition(0);
setMarkerDisplay(true);
setUseSeriesShapes(false);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setY1LabelDisplay(true);
setY1AxisSide(0);
setTextFormatPreset(getY1Label(),1);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setFontSize(getO1Label(),12);
setFontSizeAbsolute(getO1Label(),true);
setPlace(true);
ENDSTYLE
END
-EXIT


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
Hi Tom,

Excellent! Changing the ACROSS's to BY's and using GRMERGE did it.

Many thanks Smiler


WebFocus 765. iSeries v5r4
 
Posts: 175 | Location: England | Registered: April 11, 2006Report This Post
Expert
posted Hide Post
Hi Mark,

Welcome, glad it worked for you...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report 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] Change order of the X Axis for a Bar Chart

Copyright © 1996-2020 Information Builders