Jump to content

Set 2nd Y Axis the same as 1st Y Axis


Kristi Carter

Recommended Posts

You could calculate the max bar value, -READFILE it into a variable and then set that for both scales. Here's an example.

image.png.16b7e387961222117ab7bc171376f6b7.png

 DEFINE FILE ibisamp/ggsales
 BOTH/P14 = DOLLARS + UNITS;
 END

 TABLE FILE ibisamp/ggsales
 SUM BOTH
 BY REGION
 ON TABLE HOLD AS SCALEMAX
 END
 
 TABLE FILE SCALEMAX
 SUM MAX.BOTH
 ON TABLE HOLD AS MAXSCALE
-RUN
-SET &BOTH = 0;
-READFILE MAXSCALE
-SET &BOTH = &BOTH * 1.05;

GRAPH FILE ibisamp/ggsales
SUM DOLLARS
    UNITS
 BY REGION
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPlace(true); 
setScaleMax( getY1Axis(), &BOTH );
setScaleMax( getY2Axis(), &BOTH );
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=DATA, COLUMN=N2, BUCKET=y-axis(1), $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis(2), $
TYPE=DATA, COLUMN=N1, BUCKET=X-axis, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*GRAPH_JS_FINAL
"blaProperties": { "seriesLayout": "stacked" },
"agnosticSettings": { "chartTypeFullName": "Bar_Stacked_Dual_Axis" }
*END
ENDSTYLE
END

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...