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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at email@example.com and provide your corporate email address, company, and name.
I am trying to make a gauge chart that shows current sales, 1st target and 2nd target. The min/max values of each band are calculated using the total sales and therefore, are dynamic.
I was able to do it using the scripts below but the format is JSCHART. I'd like to make it as an image (png/gif...) Does anyone know how to do it?
-*Use Car as an example: BTW The scripts is running well in App Studio but returns an error message in info assistant and I don't know why...
SET HOLDLIST=PRINTONLY TABLE FILE CAR SUM SALES COMPUTE 1ST_TARGET/I10=TOT.SALES * 1.15; COMPUTE 2ND_TARGET/I10=1ST_TARGET * 1.15; BY COUNTRY WHERE COUNTRY EQ 'ENGLAND'; ON TABLE HOLD AS A1 END -RUN
TABLE FILE A1 SUM A1.A1.1ST_TARGET NOPRINT COMPUTE REDMAX/I10=C1/3; COMPUTE YELLOWMIN/I10=C1/3*2; COMPUTE YELLOWMAX/I10=C1; COMPUTE DARKGREENMIN/I10=C1*1.15; COMPUTE DARKGREENMAX/I10=C1*1.33; ON TABLE HOLD AS VALUES FORMAT ALPHA PRINT * END -RUN -READ VALUES &REDMAX.A10 &YELLOWMIN.A10.&YELLOWMAX.A10.&DARKGREENMIN.A10.&DARKGREENMAX.A10.
GRAPH FILE CAR SUM SALES COMPUTE 1ST_TARGET/I10=TOT.SALES * 1.15; COMPUTE 2ND_TARGET/I10=1ST_TARGET * 1.15; BY COUNTRY WHERE COUNTRY EQ 'ENGLAND'; ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET VZERO OFF ON GRAPH SET HTMLENCODE ON ON GRAPH SET GRMERGE ADVANCED ON GRAPH SET GRMULTIGRAPH 0 ON GRAPH SET GRLEGEND 0 ON GRAPH SET GRXAXIS 1 ON GRAPH SET LOOKGRAPH GAUGE1 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=&WF_TITLE.QUOTEDSTRING, $ *GRAPH_SCRIPT setReportParsingErrors(false); setSelectionEnableMove(false); setY1ExcludeMaxLabel(true); setPlace(true); setGaugeBackgroundStyle(6); setGaugeStopAngle(0.0); setGaugeSizeMode(false); setGaugeStartAngle(180.0); setTransparentFillColor(getFrame(),true); setTextFormatPreset(getY1Label(),0); setFillColor(getSeries(0),new Color(255,128,0)); setFillColor(getSeries(1), new Color(187,0,187,38)); setFillColor(getSeries(2), new Color(187,0,187,38)); setGaugeMinorTickRelativeTickLength(0.02); setGaugeMajorTickRelativeTickLength(0.06); setGaugeNeedleStyle(0);
I tried with InfoAssist 8.1.09 and it worked but with 8.2.03 it asked me to put values in parameters "&REDMAX.A10 &YELLOWMIN.A10.&YELLOWMAX.A10.&DARKGREENMIN.A10.&DARKGREENMAX.A10.". It seems the "-Read Values" does not work very well.
I also tried to call values from database to define band starts and band ends. I almost got the gauge chart I need. The only problem is that the ScaleMax is a bit smaller than the value I defined. I will post the sample codes using car data later.