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.
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,
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
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.
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, 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
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,
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