Focal Point
[CLOSED] Reduce space between bars JSCHART

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8737053196

June 07, 2019, 10:11 AM
BI_Developer
[CLOSED] Reduce space between bars JSCHART
Hello all

I have this sample code for a stacked bar graph. I am trying to reduce the vertical gap between bars (gets bars for countries close to each other).
However I try, it stays the same. Can anyone suggest what I should do?
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
GRAPH FILE CAR
SUM RETAIL_COST
DEALER_COST
BY COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis, $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $
*GRAPH_SCRIPT
*GRAPH_JS_FINAL
"blaProperties": 
{
    "seriesLayout": "stacked", "orientation": "horizontal", "barGroupGapWidth": "0.5"
},
*END
ENDSTYLE
END  

Thank you

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


WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
June 07, 2019, 10:29 AM
Tom Flynn
The riser width is a percentage of the space available for each group of bars.

Play with these settings, see if any work for you:

-SORT_DONE
ON GRAPH SET GRAPHSTYLE *
-*Adjust Riser Column Width
setRiserWidth(90);
setLineWidth(getSeries(0),6)
setLineWidth(getSeries(1),6)
setLineWidth(getSeries(2),6)


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
June 07, 2019, 10:32 AM
MartinY
Does work as expected
It is possible that you haven't notice the change. Try with more significant decrease. Run with multiple value and compare output
The only thing as that the bar width is increasing accordingly to gap decreasing
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
GRAPH FILE CAR
SUM RETAIL_COST
DEALER_COST
BY COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis, $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $
*GRAPH_SCRIPT
*GRAPH_JS_FINAL
"blaProperties": 
{
    "seriesLayout": "stacked", "orientation": "horizontal", "barGroupGapWidth": "0.25"
},
*END
ENDSTYLE
END



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
June 07, 2019, 11:22 AM
BI_Developer
I tried this before. It reduces the gap but that is done by increase of bar width. I am trying to reduce height of the graph. With this height stays the same as width of bar is increased and gap is reduced. Hope I made sense.
quote:
Originally posted by MartinY:
Does work as expected
It is possible that you haven't notice the change. Try with more significant decrease. Run with multiple value and compare output
The only thing as that the bar width is increasing accordingly to gap decreasing
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
GRAPH FILE CAR
SUM RETAIL_COST
DEALER_COST
BY COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis, $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $
*GRAPH_SCRIPT
*GRAPH_JS_FINAL
"blaProperties": 
{
    "seriesLayout": "stacked", "orientation": "horizontal", "barGroupGapWidth": "0.25"
},
*END
ENDSTYLE
END



WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
June 07, 2019, 11:31 AM
MartinY
Do you include this report within a Portal or HTML iFrame ?

Reducing the iFrame does not work for you ? Everything is adjusted automatically even without having to manage the gap as you are trying to do.
Remember that you are using JSCHART so the engine will always try to use all available spaces otherwise it shrink


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