Jump to content

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


Go to solution Solved by David Beagan ,

Recommended Posts

  • Solution
Posted

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

 

  • Like 1
  • 1 month later...
Posted

I wanted to include this as well, I got this option from an ibi ticket, which seemed to work as wel.

 

We can make both axes to be same by using the "autoGlobal" property for the axis minimum and maximum values, added via the text editor. 

kindly refer the official tibco documentation, which contains the detailed information of Synchronizing both the axes,

Doc: https://docs.tibco.com/pub/focus/9.3.0/doc/pdf/IBI_focus_9.3.0_html5_charts.pdf

Topic: Synchronize the Axis Maximum and Minimum Values on Dual-Y and Split-Y Charts - Page no: 479

Kindly add the below command via the text editor,

"yaxis":
{
"min": "autoGlobal",
"max": "autoGlobal"
},
"y2axis":
{
"min": "autoGlobal",
"max": "autoGlobal"
}
  • Like 1

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