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.
I'm sure there is a graphing wizard out on focal point somewhere that can help me.
The problem arises when I’m trying to graph over a one year period and only three periods have data so far. For some reason, with vertical line graphs, it wants to continue the line graph at zero for the months that don’t have any data. I would like it to just stop at the month where the data stops.
I’ve tried to get ‘VZERO’ to work but with no luck at all. If I set it to ‘OFF’, it only graphs the first two periods and doesn’t even include the other 10 periods. If I have it set to ‘ON’, then it displays the graph at zero all the way across when no data exists.
I came up with an example using the SALES file. If anyone has a workaround to avoid this behavior, that would be great!
Thanks,
Keith
DEFINE FILE SALES PERIOD/A3=IF AREA EQ 'S' THEN 'P01' ELSE IF AREA EQ 'U' THEN 'P02' ELSE 'P03'; PERIOD_2DIG/A2=EDIT(PERIOD,'$99'); PERIOD_LABEL/A3='P'|PERIOD_2DIG; END
TABLE FILE SALES PRINT * PERIOD_LABEL ON TABLE HOLD AS HOLD1 END
SET HOLDLIST=PRINTONLY
TABLE FILE HOLD1 SUM COMPUTE UNIT_SOLD/P12 MISSING ON = UNIT_SOLD; COMPUTE RETAIL_PRICE/P12.2 MISSING ON = RETAIL_PRICE; BY PERIOD_LABEL ROWS 'P01' OVER 'P02' OVER 'P03' OVER 'P04' OVER 'P05' OVER 'P06' OVER 'P07' OVER 'P08' OVER 'P09' OVER 'P10' OVER 'P11' OVER 'P12' ON TABLE HOLD AS HOLD2 END
GRAPH FILE HOLD2 SUM UNIT_SOLD/P12C AS 'Units Sold' RETAIL_PRICE/P12.2M AS 'Retail Price' ACROSS E01 AS '' COLUMNS 'P01' AND 'P02' AND 'P03' AND 'P04' AND 'P05' AND 'P06' AND 'P07' AND 'P08' AND 'P09' AND 'P10' AND 'P11' AND 'P12' ON GRAPH PCHOLD FORMAT PNG ON GRAPH SET HTMLENCODE ON ON GRAPH SET GRAPHDEFAULT OFF ON GRAPH SET VZERO ON ON GRAPH SET HAXIS 770 ON GRAPH SET VAXIS 405 ON GRAPH SET UNITS PIXELS ON GRAPH SET LOOKGRAPH VLINSTK2 ON GRAPH SET GRMERGE ADVANCED ON GRAPH SET GRMULTIGRAPH 0 ON GRAPH SET GRLEGEND 0 ON GRAPH SET GRXAXIS 1 ON GRAPH SET GRAPHSTYLE * setReportParsingErrors(false); setSelectionEnableMove(false); setDepthRadius(0); setUseSeriesShapes(true); setMarkerSizeDefault(50); setTransparentBorderColor(getChartBackground(),true); setPlace(true); setDisplay(getY2MajorGrid(),false); setTextString(getTitle(),"Units Sold/Retail Price"); setDisplay(getTitle(),true); setTextString(getY1Title(),"Units"); setDisplay(getY1Title(),true); setTextString(getY2Title(),"Dollars"); setDisplay(getY2Title(),true); setTextFormatPreset(getY1Label(),-1); setTextFormatPreset(getY2Label(),6); setDisplay(getO1Label(),true); setTextRotation(getO1Label(),0); ENDSTYLE ENDThis message has been edited. Last edited by: Kerry,
WebFOCUS 8.104 Windows, All Outputs
Posts: 28 | Location: Holland, MI USA | Registered: September 30, 2010
From AGA do the following: To prevent the X-axis from going to 0 in a line graph you can do the following:
1) Open Advanced Graph Assistant 2) Click on the Chart Editor 3) Scroll down to the Advanced\Select Data Handling 4) For Fill Missing Data you can change this to skip or zero
Also test code below:
-* File zero_graph.fex
GRAPH FILE CAR
SUM
COMPUTE TARGET/I9 MISSING ON = IF SALES NE 0 THEN SALES ELSE MISSING;
BY MODEL
WHERE COUNTRY EQ 'JAPAN' OR 'FRANCE' OR 'ITALY';
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET GRID ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(true);
setConnectScatterMarkers(true);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,2);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
setFillMissingData(0);
setNumMissingDataSegments(5);
ENDSTYLE
ON GRAPH SET STYLE *
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
$
ENDSTYLE
END
Cheers, Kerry
Kerry Zhan Focal Point Moderator Information Builders, Inc.
Posts: 1948 | Location: New York | Registered: November 16, 2004
Thanks for your response. If you run the code that I provided using the SALES file, you will see my issue. The code that you provided doesn't address the issue of using an Across for the X Axis and that some of the items will not have a value yet becuase it's for a 12 period Fiscal year. I noticed that the VZERO in your example is set to OFF. On mine, it needs to be set to ON because otherwise, it ignores the periods that don't have data yet. Each month, I want the line graph to show all twelve periods but only graph the periods that actually have data. Right now, when it encounters a period that has now data yet, it goes down to zero and flat lines for the rest of the Fiscal year. It doesn't look very pleasent and at the beginning of a new fiscal year, we will have the same issue. I was going to open up a ticket with support because this is a hot item for a current customer and i need to have the line graph only graph periods that actually have data.
Keith
WebFOCUS 8.104 Windows, All Outputs
Posts: 28 | Location: Holland, MI USA | Registered: September 30, 2010
I posted a few years ago that I beleive that a bug preventing VZERO etc. from being effective keeps on reappearing in some releases. I am not sure if this is the case here, but there are a few work arounds that can be employed to ensure that it would always function as you want it to.
One of the best methods (IMHO) was from Waz in March this year (here) (and I've tried a few!!). The basic idea is to set any missing values to a value that does not appear in your required data and then set a couple of JAVA lines to control the minimum axis value that you would expect and prevent values lower than this from being displayed.
As you are using a double axis graph, you would need to add addtional controls for the second axis within your code.
The following code shows you where you need to change your code (btw, the first two steps that you had could be done in a single pass) -
SET HOLDMISS = ON
DEFINE FILE SALES
PERIOD/A3 = IF AREA EQ 'S' THEN 'P01' ELSE IF AREA EQ 'U' THEN 'P02' ELSE 'P03';
PERIOD_2DIG/A2 = EDIT(PERIOD,'$99');
PERIOD_LABEL/A3 = 'P'|PERIOD_2DIG;
END
TABLE FILE SALES
PRINT *
BY PERIOD_LABEL ROWS 'P01' OVER 'P02' OVER 'P03' OVER 'P04' OVER
'P05' OVER 'P06' OVER 'P07' OVER 'P08' OVER
'P09' OVER 'P10' OVER 'P11' OVER 'P12'
ON TABLE HOLD AS HOLD1
END
-RUN
GRAPH FILE HOLD1
-* Set values to a value lower than the smallest expected.
SUM COMPUTE UNITS/P12C = IF UNIT_SOLD EQ MISSING THEN -1 ELSE UNIT_SOLD; AS 'Units Sold'
COMPUTE PRICE/P12.2M = IF RETAIL_PRICE EQ MISSING THEN -1 ELSE RETAIL_PRICE; AS 'Retail Price'
BY E01 AS ''
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO ON
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VLINSTK2
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
-*setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(0);
setUseSeriesShapes(true);
setMarkerSizeDefault(50);
setTransparentBorderColor(getChartBackground(),true);
setPlace(true);
-* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-* Y1 Set minimum axis value and prevent display of lower values
setY1ScaleMinAuto(false);
setY1ScaleMin(0.0);
setDisplayOffScale(getY1Axis(),false);
-* Y2 Set minimum axis value and prevent display of lower values
setY2ScaleMinAuto(false);
setY2ScaleMin(0.0);
setDisplayOffScale(getY2Axis(),false);
-* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setDisplay(getY2MajorGrid(),false);
setTextString(getTitle(),"Units Sold/Retail Price");
setDisplay(getTitle(),true);
setTextString(getY1Title(),"Units");
setDisplay(getY1Title(),true);
setTextString(getY2Title(),"Dollars");
setDisplay(getY2Title(),true);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPreset(getY2Label(),6);
setDisplay(getO1Label(),true);
setTextRotation(getO1Label(),0);
ENDSTYLE
END
T
Edited because the speel chucker wasn't switched on!This message has been edited. Last edited by: Tony A,
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, 2004