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] JS Chart problem: negative value overlaps dimension name

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] JS Chart problem: negative value overlaps dimension name
 Login/Join
 
Expert
posted
I used the GUI many months ago to create a JS Chart type of bar chart (with subsequent manual edits, of course). I now have a problem when the chart renders - the negative value of one of the measures overlaps the dimension name. The fex below replicates my real-world problem. Any ideas? I don't see how I can reserve space for the dimension name so that the bar negative value does not overlap.



-SET &ECHO=ON;
SET MSG=ON

DEFINE FILE CAR
WEIGHT/D20.6 =
     IF COUNTRY EQ 'ENGLAND'                        THEN 2.16
ELSE IF COUNTRY EQ 'JAPAN'                          THEN 27.885
ELSE IF COUNTRY EQ 'ITALY' AND CAR EQ 'ALFA ROMEO'  THEN 5.81
ELSE IF COUNTRY EQ 'W GERMANY' AND CAR EQ 'BMW'     THEN 9.60
ELSE IF COUNTRY EQ 'FRANCE'                         THEN 9.55
ELSE IF COUNTRY EQ 'ITALY' AND CAR EQ 'MASERATI'    THEN 20.00
ELSE IF COUNTRY EQ 'W GERMANY' AND CAR EQ 'AUDI'    THEN -7.22
ELSE 0;

SHORTNAME/A12 =
     IF COUNTRY EQ 'ENGLAND'                        THEN 'NDG QE'
ELSE IF COUNTRY EQ 'JAPAN'                          THEN 'GHI EVD QE'
ELSE IF COUNTRY EQ 'ITALY' AND CAR EQ 'ALFA ROMEO'  THEN 'FF QE'
ELSE IF COUNTRY EQ 'W GERMANY' AND CAR EQ 'BMW'     THEN 'QWF IF'
ELSE IF COUNTRY EQ 'FRANCE'                         THEN 'PPC Bands'
ELSE IF COUNTRY EQ 'ITALY' AND CAR EQ 'MASERATI'    THEN 'DAF'
ELSE IF COUNTRY EQ 'W GERMANY' AND CAR EQ 'AUDI'    THEN 'Total Cash'
ELSE 'X';

SORT_SEQ/I2 =
     IF COUNTRY EQ 'ENGLAND'                        THEN 1
ELSE IF COUNTRY EQ 'JAPAN'                          THEN 2
ELSE IF COUNTRY EQ 'ITALY' AND CAR EQ 'ALFA ROMEO'  THEN 3
ELSE IF COUNTRY EQ 'W GERMANY' AND CAR EQ 'BMW'     THEN 4
ELSE IF COUNTRY EQ 'FRANCE'                         THEN 5
ELSE IF COUNTRY EQ 'ITALY' AND CAR EQ 'MASERATI'    THEN 6
ELSE IF COUNTRY EQ 'W GERMANY' AND CAR EQ 'AUDI'    THEN 7
ELSE 99;

END
-RUN

TABLE FILE CAR
SUM
MIN.WEIGHT
MIN.SHORTNAME
MIN.SORT_SEQ

BY COUNTRY NOPRINT
BY CAR NOPRINT

ON TABLE HOLD AS HROLLUP1
END
-RUN

ENGINE INT CACHE SET ON
-SET &WF_STYLE_UNITS='PIXELS';
-SET &WF_STYLE_HEIGHT='220.0';
-SET &WF_STYLE_WIDTH='460.0';

GRAPH FILE HROLLUP1

-* Originally created by Info Assist for Graph
SUM
WEIGHT          AS 'Weight'
BY SORT_SEQ NOPRINT
BY SHORTNAME    AS 'Category'

ON GRAPH PCHOLD FORMAT JSCHART

ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET LOOKGRAPH HBAR
-*ON GRAPH SET AUTOFIT ON

ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT='Testing', $
*GRAPH_SCRIPT
setToolTipDisplay(false);
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDisplay(getO1Title(),false);
setDisplay(getDataText(0), true);
setDisplay(getY1Title(),false);
setTextFormatPreset(getDataText(),30);
setDisplay(getDataText(),true);
setUseNegativeDataTextColor(true);
setColorMode(2);
setDisplay(getY1Label(),false);
setFontName(getO1Label(),"CALIBRI");
setFontSizeAbsolute(getO1Label(), true);
setFontSizeInPoints(getO1Label(), 10);
setPlaceResize(getO1Label(), 0);
setFontSizeAbsolute(getDataText(),true);
setAutofit(getDataText(),false);
setFontSizeInPoints(getDataText(),10);
setPlaceResize(getDataText(),0);
setFontName(getDataText(),"CALIBRI");
setTransparentFillColor(getFrame(),true);
setFrameAutoShade(false);
setTransparentFillColor(getFrameSide(),true);
setTransparentBorderColor(getFrameSide(),true);
setTransparentFillColor(getFrameBottom(),true);
setTransparentBorderColor(getFrameBottom(),true);
setDisplay(getY1MajorGrid(),false);
setPieTilt(0);
setPieDepth(0);
setDepthRadius(0);
setDepthAngle(0);
setFillColor(getFrame(),new Color(225,225,231));
setDisplay(getO1MajorGrid(),false);
setDataTextPosition(1);

*GRAPH_SCRIPT
setFillColor(getSeries(0),new Color(061,128,161));      // #3D80A1 - CDN EQ
setFillColor(getSeries(1),new Color(086,155,190));      // #569BBE - FGN DEV EQ
setFillColor(getSeries(2),new Color(140,186,212));      // #8CBAD4 - EM EQ
setFillColor(getSeries(3),new Color(182,102,022));      // #B66616 - NOM FI
setFillColor(getSeries(4),new Color(209,117,025));      // #D17519 - CPP Bonds
setFillColor(getSeries(5),new Color(233,150,067));      // #E99643 - FSB
setFillColor(getSeries(6),new Color(204,181,118));      // #CCB576 - Total Cash

*GRAPH_JS
"mouseOverIndicator": {
  "enabled": true,
  "color": "rgba(255,255,255,0.3)",
  "marker": {"size": 0}
  },
  "riserBevel": "none"
,"yaxis": {
  "baseLineStyle": {"width": 2, "color": "rgb(138, 138, 138)"},
  "bodyLineStyle": {"width": 2, "color": "white"}
  }
,"xaxisOrdinal": {
  "bodyLineStyle": {"width": 2, "color": "white"}
  }
*END
ENDSTYLE
END
-RUN

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
I've minimized the chart code but I still get the issue.



-SET &ECHO=ON;
SET MSG=ON

DEFINE FILE CAR
WEIGHT/D20.6 =
     IF COUNTRY EQ 'ENGLAND'                        THEN 2.16
ELSE IF COUNTRY EQ 'JAPAN'                          THEN 27.885
ELSE IF COUNTRY EQ 'ITALY' AND CAR EQ 'ALFA ROMEO'  THEN 5.81
ELSE IF COUNTRY EQ 'W GERMANY' AND CAR EQ 'BMW'     THEN 9.60
ELSE IF COUNTRY EQ 'FRANCE'                         THEN 9.55
ELSE IF COUNTRY EQ 'ITALY' AND CAR EQ 'MASERATI'    THEN 20.00
ELSE IF COUNTRY EQ 'W GERMANY' AND CAR EQ 'AUDI'    THEN -7.22
ELSE 0;

SHORTNAME/A12 =
     IF COUNTRY EQ 'ENGLAND'                        THEN 'NDG QE'
ELSE IF COUNTRY EQ 'JAPAN'                          THEN 'GHI EVD QE'
ELSE IF COUNTRY EQ 'ITALY' AND CAR EQ 'ALFA ROMEO'  THEN 'FF QE'
ELSE IF COUNTRY EQ 'W GERMANY' AND CAR EQ 'BMW'     THEN 'QWF IF'
ELSE IF COUNTRY EQ 'FRANCE'                         THEN 'PPC Bands'
ELSE IF COUNTRY EQ 'ITALY' AND CAR EQ 'MASERATI'    THEN 'DAF'
ELSE IF COUNTRY EQ 'W GERMANY' AND CAR EQ 'AUDI'    THEN 'Total Cash'
ELSE 'X';

SORT_SEQ/I2 =
     IF COUNTRY EQ 'ENGLAND'                        THEN 1
ELSE IF COUNTRY EQ 'JAPAN'                          THEN 2
ELSE IF COUNTRY EQ 'ITALY' AND CAR EQ 'ALFA ROMEO'  THEN 3
ELSE IF COUNTRY EQ 'W GERMANY' AND CAR EQ 'BMW'     THEN 4
ELSE IF COUNTRY EQ 'FRANCE'                         THEN 5
ELSE IF COUNTRY EQ 'ITALY' AND CAR EQ 'MASERATI'    THEN 6
ELSE IF COUNTRY EQ 'W GERMANY' AND CAR EQ 'AUDI'    THEN 7
ELSE 99;

END
-RUN

TABLE FILE CAR
SUM
MIN.WEIGHT
MIN.SHORTNAME
MIN.SORT_SEQ

BY COUNTRY NOPRINT
BY CAR NOPRINT

ON TABLE HOLD AS HROLLUP1
END
-RUN

ENGINE INT CACHE SET ON
-SET &WF_STYLE_UNITS='PIXELS';
-SET &WF_STYLE_HEIGHT='220.0';
-SET &WF_STYLE_WIDTH='460.0';

GRAPH FILE HROLLUP1

-* Originally created by Info Assist for Graph
SUM
WEIGHT          AS 'Weight'
BY SORT_SEQ NOPRINT
BY SHORTNAME    AS 'Category'

ON GRAPH PCHOLD FORMAT JSCHART

ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET LOOKGRAPH HBAR

ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT='Testing', $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setDisplay(getO1Title(),false);
setDisplay(getDataText(0), true);
setDisplay(getY1Title(),false);
setTextFormatPreset(getDataText(),30);
ENDSTYLE
END
-RUN


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Hi Francis,
May try this:

setScaleMin(getY1Axis(),-020.0);

hth


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
Tom, that works! Thanks very much. I've added code to dynamically calculate the minimum value and this works. (I have to do the same for the maximum value because in Chrome the max measure value gets cut off - evidence is seen in the second image I posted where the max measure value overflows the chart in IE).

Thanks very much!


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Cool Beans!
Very Welcome, Sir!


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
It's a beautiful thing!

Thanks! I thought I was stuck.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
By default I guess it should be automatically set. sounds like a bug in the charting engine.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Wazzat? A Bug? Never! Smiler


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Yeah you are right.

What was I thinking.

Just wait for D3 Charts


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 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] JS Chart problem: negative value overlaps dimension name

Copyright © 1996-2020 Information Builders