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] Duplicate Y axis labels in horizontal bar graph

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Duplicate Y axis labels in horizontal bar graph
 Login/Join
 
Gold member
posted
The horizontal bar graph shows redundant Y axis labels when the range of Y axis values is small. I have a CAR file example to demonstrate this problem. When you run it, you see C_TEST1 values 0% and 1% repeating few times. Instead
of graphing C_TEST1 if you change it to C_TEST2 which has wider range of values, the labels don't repeat.
We need to dispaly the labels only once. I searched the Focal Point and tried with several graph properties which you can see commented in the code. Is there any method or property to get rid of redundant labels? Thanks.

-* File car-Hbar.fex
TABLE FILE CAR
SUM
COMPUTE C_TEST1/D4.2 = IF RETAIL_COST EQ 0 THEN 0 ELSE (RETAIL_COST/(DEALER_COST*100));
COMPUTE C_TEST2/D4.2 = IF DEALER_COST EQ 0 THEN 0 ELSE (DEALER_COST/SALES);
BY CAR
ON TABLE HOLD AS HOLD1
END

GRAPH FILE HOLD1
PRINT
C_TEST1
-*C_TEST2
BY CAR

ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 900
ON GRAPH SET VAXIS 500
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH HBAR
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);
setPlace(false);
setDisplay(getTitle(),true);
setLegendPosition(-1);
setDepthRadius(0);
setDepthAngle(0);
setDisplay(getDataText(),true);
setTransparentFillColor(getFrame(),true);
setTransparentBorderColor(getFrame(),true);
setDisplay(getO1MajorGrid(),true);
setZeroValueDataTextDisplay(false);
setTextRotation(getDataText(),0);
setDisplay(getLegendArea(),false);
setFontSizeAbsolute(getTitle(), true);
setFontSizeInPoints(getTitle(), 11);
setPlaceResize(getTitle(), 0);
setFontSizeAbsolute(getO1Label(), true);
setFontSizeInPoints(getO1Label(), 8);
setPlaceResize(getO1Label(), 0);
setTextString(getO1Title(),"");
setTextFormatPreset(getY1Label(),2);
setDisplay(getY1MajorGrid(),true);
setTextFormatPattern(getDataText(),"#.#");
setTextFormatPreset(getDataText(),2);

-*setY1LabelStagger(true);
-*setAutoSkip(getY1Axis(), 2);
-*setSkipBegin(getY1Axis(), 2);
-*setSkipCount(getY1Axis(), 2);
-*setO1LabelSkipBegin(4);
-*setO1LabelAutoSkip(2);
-*setO1LabelSkipCount(4);
-*setDisplay(getY1Label(),false);

-*SetScaleMin(getY1Axis(), 0.1);
-*-*SetY1ScaleMinAuto(getY1Axis(), false);
-*-*setY1ScaleMin(1);
-*setY1ScaleMinAuto(true);
-*setGridStep(getY1MajorGrid(),2);
-*setGridStep(getY1MinorGrid(),2);
-*setGridStepAuto(getY1MajorGrid(),true);

ENDSTYLE
END

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


7.6.9, XP
 
Posts: 60 | Location: Cary, NC | Registered: February 19, 2008Report This Post
Expert
posted Hide Post
Is this what you are trying to accomplish???

  
TABLE FILE CAR
SUM
COMPUTE C_TEST1/P6.2% = IF RETAIL_COST EQ 0 THEN 0 ELSE (RETAIL_COST/DEALER_COST) * 100;
COMPUTE C_TEST2/P6.2 = IF DEALER_COST EQ 0 THEN 0 ELSE (DEALER_COST/SALES);
BY CAR
WHERE RETAIL_COST NE 0;
ON TABLE HOLD AS HOLD1
END
-RUN
GRAPH FILE HOLD1
PRINT
C_TEST1
-*C_TEST2
BY CAR

ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 900
ON GRAPH SET VAXIS 500
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH HBAR
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);
setPlace(false);
setDisplay(getTitle(),true);
setLegendPosition(-1);
setDepthRadius(0);
setDepthAngle(0);
setDisplay(getDataText(),true);
setTransparentFillColor(getFrame(),true);
setTransparentBorderColor(getFrame(),true);
setDisplay(getO1MajorGrid(),true);
setZeroValueDataTextDisplay(false);
setTextRotation(getDataText(),0);
setDisplay(getLegendArea(),false);
setFontSizeAbsolute(getTitle(), true);
setFontSizeInPoints(getTitle(), 11);
setPlaceResize(getTitle(), 0);
setFontSizeAbsolute(getO1Label(), true);
setFontSizeInPoints(getO1Label(), 8);
setPlaceResize(getO1Label(), 0);
setTextString(getO1Title(),"");
-*setTextFormatPreset(getY1Label(),2);
setDisplay(getY1MajorGrid(),true);
setTextFormatPattern(getDataText(),"###.##%");
-*setTextFormatPreset(getDataText(),2);

-*setY1LabelStagger(true);
-*setAutoSkip(getY1Axis(), 2);
-*setSkipBegin(getY1Axis(), 2);
-*setSkipCount(getY1Axis(), 2);
-*setO1LabelSkipBegin(4);
-*setO1LabelAutoSkip(2);
-*setO1LabelSkipCount(4);
-*setDisplay(getY1Label(),false);

-*SetScaleMin(getY1Axis(), 0.1);
-*-*SetY1ScaleMinAuto(getY1Axis(), false);
-*-*setY1ScaleMin(1);
-*setY1ScaleMinAuto(true);
-*setGridStep(getY1MajorGrid(),2);
-*setGridStep(getY1MinorGrid(),2);
-*setGridStepAuto(getY1MajorGrid(),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
Gold member
posted Hide Post
No. I want to see them as Percentages, but I don't want the Y axis to show each label multiple times. In other words, I want to see 0% and 1% only once on Y axis instead of each repeating 3 times. I think this is an issue with any data format when the Y axis value range is very small.
Thanks for your response though.


7.6.9, XP
 
Posts: 60 | Location: Cary, NC | Registered: February 19, 2008Report This Post
Expert
posted Hide Post
You are getting those values because there are multiple Models for the Car.
I think you need to do the Math another way, I feel this will give the correct results; try this:
 
DEFINE FILE CAR
C_TEST1/D4.2 = IF RETAIL_COST EQ 0 THEN 0 ELSE (RETAIL_COST/(DEALER_COST*100));
END

GRAPH FILE CAR
SUM
C_TEST1
-*C_TEST2
BY CAR

ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 700
ON GRAPH SET VAXIS 500
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH HBAR
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);
setPlace(false);
setDisplay(getTitle(),true);
setLegendPosition(-1);
setDepthRadius(0);
setDepthAngle(0);
setDisplay(getDataText(),true);
setTransparentFillColor(getFrame(),true);
setTransparentBorderColor(getFrame(),true);
setDisplay(getO1MajorGrid(),true);
setZeroValueDataTextDisplay(false);
setTextRotation(getDataText(),0);
setDisplay(getLegendArea(),false);
setFontSizeAbsolute(getTitle(), true);
setFontSizeInPoints(getTitle(), 11);
setPlaceResize(getTitle(), 0);
setFontSizeAbsolute(getO1Label(), true);
setFontSizeInPoints(getO1Label(), 8);
setPlaceResize(getO1Label(), 0);
setTextString(getO1Title(),"");
setTextFormatPreset(getY1Label(),2);
setDisplay(getY1MajorGrid(),true);
setTextFormatPattern(getDataText(),"#.#");
setTextFormatPreset(getDataText(),2);

-*setY1LabelStagger(true);
-*setAutoSkip(getY1Axis(), 2);
-*setSkipBegin(getY1Axis(), 2);
-*setSkipCount(getY1Axis(), 2);
-*setO1LabelSkipBegin(4);
-*setO1LabelAutoSkip(2);
-*setO1LabelSkipCount(4);
-*setDisplay(getY1Label(),false);

-*SetScaleMin(getY1Axis(), 0.1);
-*-*SetY1ScaleMinAuto(getY1Axis(), false);
-*-*setY1ScaleMin(1);
-*setY1ScaleMinAuto(true);
-*setGridStep(getY1MajorGrid(),2);
-*setGridStep(getY1MinorGrid(),2);
-*setGridStepAuto(getY1MajorGrid(),true);

ENDSTYLE
END


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Gold member
posted Hide Post
Tom, Thanks for your resonse, but I wasn't focussing on the calculation part here. I was just trying to repoduce the duplicate graph label issue with a CAR file. If we take your example and add a where clause WHERE CAR NE 'BMW'; you can see the issue I am trying to solve. C_TEST1 labels are redundant and not spaced correctly which will result in incorrect bar height.

DEFINE FILE CAR
C_TEST1/D4.2 = IF RETAIL_COST EQ 0 THEN 0 ELSE (RETAIL_COST/(DEALER_COST*100));
END

GRAPH FILE CAR
SUM
C_TEST1
-*C_TEST2
BY CAR
WHERE CAR NE 'BMW';
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 700
ON GRAPH SET VAXIS 500
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH HBAR
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);
setPlace(false);
setDisplay(getTitle(),true);
setLegendPosition(-1);
setDepthRadius(0);
setDepthAngle(0);
setDisplay(getDataText(),true);
setTransparentFillColor(getFrame(),true);
setTransparentBorderColor(getFrame(),true);
setDisplay(getO1MajorGrid(),true);
setZeroValueDataTextDisplay(false);
setTextRotation(getDataText(),0);
setDisplay(getLegendArea(),false);
setFontSizeAbsolute(getTitle(), true);
setFontSizeInPoints(getTitle(), 11);
setPlaceResize(getTitle(), 0);
setFontSizeAbsolute(getO1Label(), true);
setFontSizeInPoints(getO1Label(), 8);
setPlaceResize(getO1Label(), 0);
setTextString(getO1Title(),"");
setTextFormatPreset(getY1Label(),2);
setDisplay(getY1MajorGrid(),true);
setTextFormatPattern(getDataText(),"#.#");
setTextFormatPreset(getDataText(),2);

-*setY1LabelStagger(true);
-*setAutoSkip(getY1Axis(), 2);
-*setSkipBegin(getY1Axis(), 2);
-*setSkipCount(getY1Axis(), 2);
-*setO1LabelSkipBegin(4);
-*setO1LabelAutoSkip(2);
-*setO1LabelSkipCount(4);
-*setDisplay(getY1Label(),false);

-*SetScaleMin(getY1Axis(), 0.1);
-*-*SetY1ScaleMinAuto(getY1Axis(), false);
-*-*setY1ScaleMin(1);
-*setY1ScaleMinAuto(true);
-*setGridStep(getY1MajorGrid(),2);
-*setGridStep(getY1MinorGrid(),2);
-*setGridStepAuto(getY1MajorGrid(),true);

ENDSTYLE
END


7.6.9, XP
 
Posts: 60 | Location: Cary, NC | Registered: February 19, 2008Report This Post
Expert
posted Hide Post
This is the culprit:
setTextFormatPreset(getY1Label(),2);

You are using fractions and, this command rounds up.

Try changing to this:
setTextFormatPreset(getY1Label(),3);

Or, remove it and see if that is what you're looking for.

Go to 3 D Graphics Manual and click on Methods Guide, Axis Labels.

Here is that link...

Lots of documentation...

hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Gold member
posted Hide Post
Sorry, I couldn't respond earlier. It's not the data format that is causing the problem. I tried some of the methods in the graph manual before and didn't get it to work. The commented block at the end of the code I posted has some of the methods I tried. I have uploaded the image to explain the problem.

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


7.6.9, XP
 
Posts: 60 | Location: Cary, NC | Registered: February 19, 2008Report This Post
Gold member
posted Hide Post
I'm having this exact same problem, except I have a multi-graph. Has anyone found the culprit?


WebFOCUS App Studio 8103
Windows7
All outputs
 
Posts: 58 | Location: London, UK | Registered: May 09, 2011Report This Post
Gold member
posted Hide Post
Is this what you are expect?

DEFINE FILE CAR
C_TEST1/D4.2 = IF RETAIL_COST EQ 0 THEN 0 ELSE (RETAIL_COST/(DEALER_COST*100));
END
GRAPH FILE CAR
SUM CAR.BODY.C_TEST1
BY CAR.COMP.CAR
WHERE CAR NE 'BMW';
ON GRAPH SET LOOKGRAPH HBAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB ON
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setUseSeriesShapes(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1ExcludeMinLabel(true);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
-*
setTextFormatPreset(getY1Label(),3);
-*
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);
setFontSizeAbsolute(getO1Label(),true);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
$
ENDSTYLE
END
 
Posts: 79 | Registered: June 12, 2012Report 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] Duplicate Y axis labels in horizontal bar graph

Copyright © 1996-2020 Information Builders