

Go  New  Search  Notify  Tools  Reply 
Guru 
Is there a way we can merge 2 different graph types into 1? What I'm trying to do is merge an Area Graph and a Scatter chart into one graph. I have 4 fields, X1, Y1, Y2, Y3 that would plot the Area Graph then over this graph, I want 2 fields, X2,Y4 to display as scatter points. Both X1 and X2 uses the same X axis and all Y* fields use the same Y axis. GRMERGE only merges different fields into the same axis but still using the same graph type. Thank you for your assistance.This message has been edited. Last edited by: Anatess, WF 8.1.05 Windows  

Expert 
Anatess, Can you provide a sample of what you really want? Perhaps in an excel file? Doug  

Guru 
What I really want is overlaying one graph over another. So, basically, I have a static area graph that shows different completion stages and how "feverish" that area is. So X is the completion percentage, Y is the buffer percentage. The area that corresponds to Y less than (.4X+10) is a low fever area. Above low fever but less than (.7X+20) is medium fever. Anything higher is high fever. Then I have a scatter graph that shows individual project completions and their corresponding buffer. Overlaying the scatter graph over the area graph would show where each project lies in the fever chart and is a quick visualization of the density of projects in each fever zone. I don't know how to illustrate this using the CAR file... WF 8.1.05 Windows  

Expert 
OK, if you cannot do it using the CAR file, then can you provide the data you want plotted and show the application of the data points to the graph? Perhaps we can some MacGyver techniques.  

Virtuoso 
Anyone know if it's possible to great a graph with a "transparent" background? If so, Anatess could just create two graphs of identical size and truly "overlay" them by providing each with the exact same coordinates. Just a thought (with no testing involved) Regards, Darin In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, SelfService, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat  

Guru 
Darin, if we can figure that one out, that would be really great! Since the area graph is static, it can even be saved as an image without having to run a graph. WF 8.1.05 Windows  

<JG> 
The answer to that is easy, It's NO. WebFocus can not create or use transparent images. The reason is a crossplatform compatibility issue (well that's what's always been claimed).  
<JG> 
Anatess now if you'd said that in the first place, that's easy. Set your area graph image as the frame background of your chart look at this article Inserting Images Into WebFOCUS Graphs You will need to use the following API calls setFillType(getFrame(),3); setTextureURL(getFrame(),"/your image.jpg"); Pay special attention to where you store the image.  
Guru 
JG, thank you very very much! I think this will work. Just need to make sure the axes are spoton (overlayed perfectly) and this should be okay. The axes are percentages, from 0 to 100, so it is static as well. WF 8.1.05 Windows  

Guru 
JG, I couldn't make it work. Okay, this is what I want to do: And this is what I get: Help! WF 8.1.05 Windows  

<JG> 
Anatess, can you post a sample of your code based on the car or one of the other standard IB files and I'll have a look at it.  
Guru 
Okay, here's the code for the background: DEFINE FILE CAR KNTR/I1 WITH SALES=KNTR + 1; CCCOMPLETE/I11 WITH SALES=IF KNTR EQ 1 THEN 0 ELSE IF KNTR EQ 2 THEN 100 ELSE 0; Y3/I3 WITH SALES=IF KNTR EQ 1 THEN 10 ELSE IF KNTR EQ 2 THEN 50 ELSE 0; Y2/I3 WITH SALES=IF KNTR EQ 1 THEN 20 ELSE IF KNTR EQ 2 THEN 90 ELSE 0; Y1/I3 WITH SALES=IF KNTR EQ 1 THEN 100 ELSE IF KNTR EQ 2 THEN 100 ELSE 0; BUFFERIMPACT/I11 WITH SALES =IF KNTR EQ 1 THEN 0; END TABLE FILE CAR PRINT Y1 Y2 Y3 BUFFERIMPACT BY CCCOMPLETE WHERE RECORDLIMIT EQ 2 ON TABLE HOLD AS FVRBGRND END RUN GRAPH FILE FVRBGRND SUM Y1 Y2 Y3 BUFFERIMPACT ACROSS CCCOMPLETE INRANGESOF 10 ON GRAPH SET LOOKGRAPH VAREA ON GRAPH SET GRAPHEDIT SERVER ON GRAPH SET BARNUMB OFF ON GRAPH SET 3D OFF ON GRAPH SET VZERO ON ON GRAPH SET GRID ON ON GRAPH PCHOLD FORMAT PNG ON GRAPH SET GRAPHSTYLE * setScaleMaxAuto(getY1Axis(),false); setScaleMax(getY1Axis(),100.0); setExtendToFrameEdge(true); setMarkerDisplay(true); setConnectLineMarkers(false); setConnectScatterMarkers(false); setO1LabelDisplay(true); setO1AxisSide(0); setO1MajorGridDisplay(true); setO1MajorGridStyle(0); setO1MinorGridDisplay(false); setAxisAssignment(0,0); setSeriesType(0,3); setAxisAssignment(1,0); setSeriesType(1,3); setAxisAssignment(2,0); setSeriesType(2,3); setAxisAssignment(3,0); setSeriesType(3,2); setY1LabelDisplay(true); setY1AxisSide(0); setY1MajorGridDisplay(true); setY1MajorGridStyle(0); setY1MinorGridDisplay(false); setGridStyle(getY1MajorGrid(),3); setGridStyle(getO1MajorGrid(),3); setTextFormatPreset(getY1Label(),1); setTextFormatPattern(getY1Label(),"#.##"); setPieFeelerTextDisplay(1); setPieLabelDisplay(0); setTextFormatPreset(getPieSliceLabel(),1); setRiserBorderMode(1); setSeriesDefaultTransparentBorderColor(true); setUseSeriesBorderDefaults(true); setLegendDisplay(true); setFontSizeAbsolute(getY1Title(),true); setFontSizeAbsolute(getY1Label(),true); setFontSizeAbsolute(getY2Title(),true); setFontSizeAbsolute(getY2Label(),true); setFontSizeAbsolute(getO1Title(),true); setPlace(true); setGridStepAuto(getY1MajorGrid(),false); setGridStep(getY1MajorGrid(),10.0); setTextRotation(getO1Label(),0); setTextString(getY1Title(),"NUMBER1"); setDisplay(getY1Title(),true); setTextString(getO1Title(),"NUMBER2"); setDisplay(getO1Title(),true); setDisplay(getLegendArea(),false); setMarkerSize(getSeries(0),0); setMarkerSize(getSeries(1),0); setMarkerSize(getSeries(2),0); setMarkerSize(getSeries(3),50); setFillColor(getSeries(3),new Color(0,0,0)); setMarkerShape(getSeries(3),6); ENDSTYLE ON GRAPH SET STYLE * PAGESIZE='Letter', LEFTMARGIN=0.250000, RIGHTMARGIN=0.250000, TOPMARGIN=0.250000, BOTTOMMARGIN=0.250000, SQUEEZE=ON, ORIENTATION=PORTRAIT, $ TYPE=REPORT, GRID=OFF, FONT='TIMES NEW ROMAN', SIZE=10, BACKCOLOR='NONE', STYLE=NORMAL, $ TYPE=DATA, ACROSSCOLUMN=N1, COLOR='RED', $ TYPE=DATA, ACROSSCOLUMN=N2, COLOR='YELLOW', $ TYPE=DATA, ACROSSCOLUMN=N3, COLOR='GREEN', $ ENDSTYLE END And here's the scatter. I commented out the background code because it will be different to your installation. DEFINE FILE CAR NUMBER1/I1= IF COUNTRY EQ 'ENGLAND' THEN 10 ELSE IF COUNTRY EQ 'JAPAN' THEN 20 ELSE IF COUNTRY EQ 'USA' THEN 30 ELSE 40; NUMBER2/I1= IF COUNTRY EQ 'ENGLAND' THEN 20 ELSE IF COUNTRY EQ 'JAPAN' THEN 40 ELSE IF COUNTRY EQ 'USA' THEN 60 ELSE 80; END GRAPH FILE CAR * Created by Advanced Graph Assistant PRINT NUMBER1 BY NUMBER2 ON GRAPH PCHOLD AS HOLD FORMAT PNG ON GRAPH SET BARNUMB OFF ON GRAPH SET 3D OFF ON GRAPH SET VZERO ON ON GRAPH SET GRID ON ON GRAPH SET HAXIS 770 ON GRAPH SET VAXIS 405 ON GRAPH SET UNITS PIXELS ON GRAPH SET LOOKGRAPH SCATTERS ON GRAPH SET GRMERGE ADVANCED ON GRAPH SET GRMULTIGRAPH 0 ON GRAPH SET GRLEGEND 0 ON GRAPH SET GRXAXIS 1 ON GRAPH SET GRAPHSTYLE * setReportParsingErrors(false); setSelectionEnableMove(false); setMarkerDisplay(true); setConnectLineMarkers(false); setConnectScatterMarkers(false); setO1LabelDisplay(true); setO1AxisSide(0); setO1MajorGridDisplay(true); setO1MajorGridStyle(0); setO1MinorGridDisplay(false); setAxisAssignment(0,0); setY1LabelDisplay(true); setY1AxisSide(0); setY1MajorGridDisplay(true); setY1MajorGridStyle(0); setY1MinorGridDisplay(false); setTextFormatPreset(getY1Label(),1); setTextFormatPattern(getY1Label(),"#.##"); setPieFeelerTextDisplay(1); setPieLabelDisplay(0); setTextFormatPreset(getPieSliceLabel(),1); setRiserBorderMode(1); setSeriesDefaultTransparentBorderColor(true); setUseSeriesBorderDefaults(true); setLegendDisplay(true); setFontSizeAbsolute(getY1Title(),true); setFontSizeAbsolute(getY1Label(),true); setFontSizeAbsolute(getY2Title(),true); setFontSizeAbsolute(getY2Label(),true); setFontSizeAbsolute(getO1Title(),true); setPlace(true); setScaleMaxAuto(getX1Axis(),false); setScaleMaxAuto(getY1Axis(),false); setScaleMax(getY1Axis(),100.0); setGridStepAuto(getY1MajorGrid(),false); setGridStep(getY1MajorGrid(),10.0); setGridStepAuto(getX1MajorGrid(),false); setGridStep(getX1MajorGrid(),10.0); *setFillType(getChartBackground(),3); *setTextureURL(getChartBackground(),"/images/custom/fever_chart.jpg"); ENDSTYLE ON GRAPH SET STYLE * TYPE=REPORT, ORIENTATION=PORTRAIT, SQUEEZE=ON, $ TYPE=REPORT, FONT='TIMES NEW ROMAN', SIZE=10, GRID=OFF, $ ENDSTYLE END WF 8.1.05 Windows  

<JG> 
Anatess best I could come up with SET &GRAPH=HHMMSS('A8'); SET &GRAPH='fever_chart'EDIT('&GRAPH.EVAL','99$99$99'); DEFINE FILE CAR KNTR/I1 WITH SALES=KNTR + 1; CCCOMPLETE/I11 WITH SALES=IF KNTR EQ 1 THEN 0 ELSE IF KNTR EQ 2 THEN 100 ELSE 0; Y3/I3 WITH SALES=IF KNTR EQ 1 THEN 10 ELSE IF KNTR EQ 2 THEN 50 ELSE 0; Y2/I3 WITH SALES=IF KNTR EQ 1 THEN 20 ELSE IF KNTR EQ 2 THEN 90 ELSE 0; Y1/I3 WITH SALES=IF KNTR EQ 1 THEN 100 ELSE IF KNTR EQ 2 THEN 100 ELSE 0; BUFFERIMPACT/I11 WITH SALES =IF KNTR EQ 1 THEN 0; END TABLE FILE CAR PRINT Y1 Y2 Y3 BUFFERIMPACT BY CCCOMPLETE WHERE RECORDLIMIT EQ 2 ON TABLE HOLD AS FVRBGRND END RUN GRAPH FILE FVRBGRND SUM Y1 AS '' Y2 AS '' Y3 AS '' BUFFERIMPACT AS '' ACROSS CCCOMPLETE AS '' INRANGESOF 10 ON GRAPH SET LOOKGRAPH VAREA ON GRAPH SET GRAPHEDIT SERVER ON GRAPH SET BARNUMB OFF ON GRAPH SET 3D OFF ON GRAPH SET HAXIS 770 ON GRAPH SET VAXIS 405 ON GRAPH SET VZERO ON ON GRAPH SET GRID OFF ON GRAPH HOLD AS &GRAPH.EVAL FORMAT JPEG ON GRAPH SET GRAPHSTYLE * setScaleMaxAuto(getY1Axis(),false); setScaleMax(getY1Axis(),100.0); setScaleMax(getO1Axis(),100.0); setExtendToFrameEdge(true); setMarkerDisplay(true); setY1LabelDisplay(false); setO1LabelDisplay(false); setO1AxisSide(0); setO1MajorGridDisplay(true); setO1MajorGridStyle(0); setO1MinorGridDisplay(false); setAxisAssignment(0,0); setSeriesType(0,3); setAxisAssignment(1,0); setSeriesType(1,3); setAxisAssignment(2,0); setSeriesType(2,3); setAxisAssignment(3,0); setSeriesType(3,2); setY1LabelDisplay(false); setY1AxisSide(0); setY1MajorGridDisplay(true); setY1MinorGridDisplay(false); setSeriesDefaultTransparentBorderColor(true); setUseSeriesBorderDefaults(true); setLegendDisplay(false); setFontSizeAbsolute(getY1Title(),true); setPlace(false); setGridStepAuto(getY1MajorGrid(),false); setGridStep(getY1MajorGrid(),10.0); setTextRotation(getO1Label(),0); setDisplay(getY1Title(),false); setDisplay(getO1Title(),flase); setDisplay(getLegendArea(),false); setMarkerSize(getSeries(0),0); setMarkerSize(getSeries(1),0); setMarkerSize(getSeries(2),0); setMarkerSize(getSeries(3),50); setFillColor(getSeries(3),new Color(0,0,0)); setMarkerShape(getSeries(3),6); ENDSTYLE ON GRAPH SET STYLE * PAGESIZE='Letter', LEFTMARGIN=0.250000, RIGHTMARGIN=0.250000, TOPMARGIN=0.250000, BOTTOMMARGIN=0.250000, SQUEEZE=ON, ORIENTATION=PORTRAIT, $ TYPE=REPORT, GRID=OFF, FONT='TIMES NEW ROMAN', SIZE=10, BACKCOLOR='NONE', STYLE=NORMAL, $ TYPE=DATA, ACROSSCOLUMN=N1, COLOR='RED', $ TYPE=DATA, ACROSSCOLUMN=N2, COLOR='YELLOW', $ TYPE=DATA, ACROSSCOLUMN=N3, COLOR='GREEN', $ ENDSTYLE END * change to your location (Note in 7.6.9, dev studio at least, any directory other than \ibi_html\javaassist\images does not work) RUN !DEL C:\ibi\DevStudio76\ibi_html\javaassist\images\&GRAPH.EVAL.jpg RUN !COPY /Y &GRAPH.EVAL.jpg C:\ibi\DevStudio76\ibi_html\javaassist\images\&GRAPH.EVAL.jpg RUN DEFINE FILE CAR NUMBER1/I1= IF COUNTRY EQ 'ENGLAND' THEN 10 ELSE IF COUNTRY EQ 'JAPAN' THEN 20 ELSE IF COUNTRY EQ 'USA' THEN 30 ELSE 40; NUMBER2/I1= IF COUNTRY EQ 'ENGLAND' THEN 20 ELSE IF COUNTRY EQ 'JAPAN' THEN 40 ELSE IF COUNTRY EQ 'USA' THEN 60 ELSE 80; END GRAPH FILE CAR * Created by Advanced Graph Assistant PRINT NUMBER1 BY NUMBER2 ON GRAPH PCHOLD AS HOLD FORMAT PNG ON GRAPH SET BARNUMB OFF ON GRAPH SET 3D OFF ON GRAPH SET VZERO ON ON GRAPH SET GRID ON ON GRAPH SET HAXIS 770 ON GRAPH SET VAXIS 405 ON GRAPH SET UNITS PIXELS ON GRAPH SET LOOKGRAPH SCATTERS ON GRAPH SET GRMERGE ADVANCED ON GRAPH SET GRMULTIGRAPH 0 ON GRAPH SET GRLEGEND 0 ON GRAPH SET GRXAXIS 1 ON GRAPH SET GRAPHSTYLE * setReportParsingErrors(false); setSelectionEnableMove(false); setMarkerDisplay(true); setConnectLineMarkers(false); setConnectScatterMarkers(false); setO1LabelDisplay(true); setO1AxisSide(0); setO1MajorGridDisplay(true); setO1MajorGridStyle(0); setO1MinorGridDisplay(false); setAxisAssignment(0,0); setY1LabelDisplay(true); setY1AxisSide(0); setY1MajorGridDisplay(true); setY1MajorGridStyle(0); setY1MinorGridDisplay(false); setTextFormatPreset(getY1Label(),1); setTextFormatPattern(getY1Label(),"#.##"); setTextFormatPreset(getPieSliceLabel(),1); setRiserBorderMode(1); setSeriesDefaultTransparentBorderColor(true); setUseSeriesBorderDefaults(true); setLegendDisplay(true); setFontSizeAbsolute(getY1Title(),true); setFontSizeAbsolute(getY1Label(),true); setFontSizeAbsolute(getY2Title(),true); setFontSizeAbsolute(getY2Label(),true); setFontSizeAbsolute(getO1Title(),true); setPlace(false); setScaleMaxAuto(getX1Axis(),false); setScaleMaxAuto(getY1Axis(),false); setScaleMax(getY1Axis(),100.0); setGridStepAuto(getY1MajorGrid(),false); setGridStep(getY1MajorGrid(),10.0); setGridStepAuto(getX1MajorGrid(),false); setGridStep(getX1MajorGrid(),10.0); setFrameDisplay(false); setFillType(getChartBackground(),3); setTextureURL(getChartBackground(),"/images/&GRAPH.EVAL.jpg"); ENDSTYLE ON GRAPH SET STYLE * TYPE=REPORT, ORIENTATION=PORTRAIT, SQUEEZE=ON, $ TYPE=REPORT, FONT='TIMES NEW ROMAN', SIZE=10, GRID=OFF, $ ENDSTYLE ENDThis message has been edited. Last edited by: <JG>,  
Expert 
Yes, we can do that in WebFOCUS! If I understand you correctly then I did this using a variation of what you started with and added some HTMLTABLE / HTMLFORM code to produce THIS. This was completed using the basic code, as follows: GRAPH FILE X ... ON GRAPH SET HAXIS 900 ON GRAPH SET VAXIS 600 ON GRAPH HOLD AS GRAPH1 FORMAT HTMTABLE ... END GRAPH FILE Y ... ON GRAPH SET HAXIS 600 ON GRAPH SET VAXIS 400 ON GRAPH HOLD AS GRAPH2 FORMAT HTMTABLE ... END HTMLFORM BEGIN ... HTMLFORM END TheEndGRAPH1 is your background and GRAPH2 is your foreground. You'll need to play around with the sizing, positions, titles, etc...  

<JG> 
That's the point Doug THIS Is exactly what Anatess does not want. As I said originally you cannot overlay two graphs because the graph engine can not produce transparent images. The only method is the one I've shown above.  
Expert 
OK JG, Thanks for the clarification... I got confused... So, Anatess, what I produced would be good IF the second graph (the grid) was transparent and the correct size for a proper overlay, right? If not, please provide a sample.  

Expert 
Actually, there is a technique to do this that I got from Summit 09. I've used it back in Nationwide as well. That is, do not use a an area chart and a scatter chart. But, rather use an area chart and a line graph. The line chart has the line connection off and the line size set to one. I'll work on it and pass it along.  

<JG> 
Doug, Test the code that I posted back for the sample code that Anatess supplied. It does exactly what she wants.  
Expert 
Thanks again JG. I continued on past your post of "Sat Jun 13 2009 03:53" for three reasons: 1) Anatess never replied as to that was what she wanted... 2) I did not get the same results as you did when I ran your code. I am running 764 on Windows. 3) I wanted to do this with only one graph. Thanks again. Your insight has been exceptional and much appreciated. I'm outta here... Case [solved]?  

Guru 
THANK YOU VERY MUCH, JG and Doug! Yes, I need that transparent background. JG, your code works like a charm!This message has been edited. Last edited by: Anatess, WF 8.1.05 Windows  

<JG> 
Anatess, pleased to help. Noticed the bug that caused Doug not to get it to work. !COPY /Y &GRAPH.EVAL.jpg C:\ibi\DevStudio\ibi_html\javaassist\images\&GRAPH.EVAL.jpg should read !COPY /Y &GRAPH.EVAL.jpg C:\ibi\DevStudio76\ibi_html\javaassist\images\&GRAPH.EVAL.jpg You obviously caught that. I've edited the post for future generations.  
Powered by Social Strata 
Please Wait. Your request is being processed... 