[CLOSED]Series 0 with proper label and Y label w/o decimal in optional K
Hi folks,
I need help to figure out how to have my Series 0 properly labeled even with only one series and have Y label without decimal but keeping the K (thousands) displayed when applicable.
Here a sample
ENGINE INT CACHE SET ON
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE ggsales
SUM COMPUTE SAL/P12.2C = IF GGSALES.SALES01.REGION EQ 'Midwest' THEN GGSALES.SALES01.DOLLARS / 10036 ELSE GGSALES.SALES01.DOLLARS; AS 'Sales$'
BY GGSALES.SALES01.REGION
BY GGSALES.SALES01.CITY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRWIDTH 2
ON GRAPH SET HAXIS 770.0
ON GRAPH SET VAXIS 150.0
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 1
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setUseSeriesShapes(true);
setMarkerSizeDefault(50);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, ORIENTATION=LANDSCAPE, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setAltFmtFrameNumColors(getY1AltFmtFrame(),5);
setDisplay(getO1MajorGrid(),false);
setAltFmtFrameNumColors(getO1AltFmtFrame(),5);
setDisplay(getY1MajorGrid(),true);
setTransparentFillColor(getFrame(),true);
setFrameAutoShade(false);
setTextString(getY1Title(),"");
setExcludeMinLabel(getO1Label(),false);
setScaleMustIncludeZero(getY1Axis(),false);
setLegendPosition(2);
setTextString(getO1Title(),"");
setFillColor(getSeries(0),new Color(8,96,74));
setReferenceTextPosition(getReferenceLineTextY1(0),2);
setDisplay(getReferenceLineY1(0),true);
setBorderColor(getReferenceLineY1(0),new Color(255,0,0));
setFillColor(getReferenceLineTextY1(0),new Color(255,0,0));
setTextFormatPreset(getY1Label(),0);
setDisplay(getLegendArea(),true);
-* DISPLAY NO DECIMAL BUT ALSO WITH FULL NUMBER LENGTH, WHICH I DON'T WANT. NEED K DISPLAYED
-*setTextFormatPreset(getY1Label(),1);
*END
ENDSTYLE
END
-RUN
In above sample you can see:
First : that "series 0" is still displayed in both legend and popup where I want "Sales $". If I have two series, each one has the proper title displayed, but with only one series, it shows "Series 0". I need to have "Sales $".
Second : the Y label. You can see that for Midwest it has decimal displayed and for others the label is in "K" (thousands). I need to remove the decimals but keeping the "K" when it's applicable. None of the available label format do that. If I use the no decimal format (setTextFormatPreset(getY1Label(),1); ), the "K" disappear to be replaced by the whole number.
Is there a way to accomplish both of my request ?
TksThis message has been edited. Last edited by: <Emily McAllister>,
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
December 01, 2016, 09:53 AM
Tony A
The first piece is easy by just dropping into the GRAPH_JS properties -
For the popup I don't mind to have the whole number and I do prefer to have it. If finally I need to have the K displayed in the popup, there are several discussions that shows how to perform such thing.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
December 08, 2016, 10:09 AM
WF1326
Martin,
Are you restricted to VAXIS width of 150? If not, increasing it removes the decimals.
WebFOCUS 7703/7705/8105m/8201m/8202m
December 08, 2016, 01:28 PM
MartinY
Thanks for the suggestion WF1326, but increasing the VAXIS creates the problem in other graph.
If you try my sample with VAXIS 200, first graph will be ok, but the below one then have decimal displayed where it don't previously.
The solution cannot be by playing with the size since the Y-grid is dynamically set according to available space.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Is your real data similar to the example with #s below and above 1000s ? How do you want the Midwest #s to look if the value is below 1000s?
setTextFormatPreset(getY1Label(),7);
setDataTextFormat(value); value = getDataTextFormat(); where: value Is an integer value between -1 and 21. 0 is the default value. -1 to use the pattern defined by DataTextFormatPattern. 0/1 for # (for example, 123 = 123) 2 for #% (for example, 123 = 12,300%) 3 for #.#% (for example, 123 = 12,300.0%) 4 for #.##% (for example, 123 = 12,300.00%) 5 for $#.## (for example, 123 = $123.00) 6 for $# (for example, 123 = $123) 7 for #K (show K for values over 999) (for example, 1,234 = 1K) 8 for $#K (show K for values over 999) (for example, 1,234 = $1K) 9 for #M (show M for millions) (for example, 1,234,567 = 1M) 10 for $#M (show M for millions) (for example, 1,234,567 = $1M) 11 for #B (show B for billions) (for example, 1,234,567,891 = 1B) 12 for $#B (show B for billions) (for example, 1,234,567,891 = $1B) 13 for #T (show T for trillions) (for example, 1,234,567,891,234 = 1T) 14 for $#T (show T for trillions) (for example, 1,234,567,891,234 = $1T) 15 for number with thousands separators, no decimal places (for example, 1,234 = 1K) 16 for number with thousands separators, two decimal places (for example, 1,234 = 1.23K) 17 for general currency format for current Locale 18 for Short Date Format: MM/DD/YY (for example, 10/01/03)
--- couple more related to date formatting ---
Thank your for participating in the Focal Point Forum, Tamra Colangelo Focal Point Moderator Information Builders
WebFOCUS 8x - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
January 04, 2017, 01:04 PM
MartinY
Hi Tamra,
Sorry for late answer.
Answer Q1 : yes, above and below 1000s Answer Q2 : without decimals, meaning whole number. Actually the Y-Axis Major grid are 368, 373.6, 379.2, 384.8, 390.4 and 396 I was attempting to see something such as 360, 370, 380, 390, 400
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007