Focal Point
[SOLVED] Changing the pattern of Stacked Bar Graph

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

September 03, 2009, 10:48 AM
Stuart
[SOLVED] Changing the pattern of Stacked Bar Graph
Hi,

I currently have some code which produces a stacked bar graph, which is displayed using "true colours", however i wish to change the display so that the colours also have differing patterns, is this possible?

I have tried looking through the GUI in the Graph assistant and had no success.

Any suggestions would be helpful since i am drawing a complete blank.

cheers

Stu.

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


WebFocus 7.6.5
Windows
HTML (some Excel and PDF)
September 03, 2009, 11:14 AM
<JG>
Take a look

http://www.informationbuilders...rs/insertimages.html
September 03, 2009, 11:33 AM
Danny-SRL
You can download and look through the WF graph manual. You will find all kinds of commands to change the color and add gradient or texture.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

September 03, 2009, 11:39 AM
Stuart
JG - does that example work for any sort of graph type?
Also will the path for the images used in the background need to be in the following path
/approot/"a folder"/sample.gif??

thanks,

Stu.


WebFocus 7.6.5
Windows
HTML (some Excel and PDF)
September 03, 2009, 11:44 AM
Francis Mariani
The document JG refers to states
quote:
The only way it works (and this is the possible second bug and/or document omission) is for the file to exist in the javaassist directory of WebFOCUS or a subdirectory of javaassist. So as I use a subdirectory to javaassist called /images/custom the API call then becomes setTextureURL(object id,"/images/custom/ file");



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 03, 2009, 11:59 AM
<JG>
Stuart,

Any type of graph can take images.

As Francis points out the location of the images had to be under \ibi\WebFOCUS76\ibi_html\javaassist\images\custom
Where custom is any folder that you want. That was based on 7.1.x.

However under 7.6.9 (and probably most of the 7.6 releases) you should use \ibi\WebFOCUS76\ibi_html\javaassist\images
September 08, 2009, 06:16 AM
Stuart
Thanks to all for the replies. I setup a folder in that path, and created some JPG files to use and put them in that path, but i still cannot get the job to run.

The code i have used so far is as follows, any ideas where i am going wrong?

GRAPH FILE HIST_LATE_RELEASE_DETAIL
SUM RLSE_LATE AS 'Late Tonnes'
ACROSS YYW_WEEK AS 'Week'
BY MD_PROD AS 'Prod'
WHERE ( YYW_WEEK GE '&START_WEEK' ) AND ( YYW_WEEK LE '&LASTWEEK' );
ON GRAPH SET LOOKGRAPH VBRSTK1
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 SET VAXIS 500
ON GRAPH SET HAXIS 900
ON GRAPH SET GRMERGE ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setFrameDisplay(false);
setRiserWidth(55);
setDataTextDisplay(true);
-*
-* Create the annotation box and
-*
setDisplay(getAnnotationBox(0), true);
setDisplay(getAnnotation(0), true);
setFontSize(getAnnotation(0),6);
setFontStyle(getAnnotation(0), 0);
setTextString(getAnnotation(0), " ");
setTransparentBorderColor(getAnnotationBox(0), false);
setRect(getAnnotation(0), new Rectangle (9000, 5000, 4800,10000));
-*
-* Set the fill type for objects that you want to contain images to texture
-*
setFillType(getSeries(0),3);
setFillType(getSeries(1),3);
setFillType(getSeries(2),3);
setFillType(getSeries(3),3);
setFillType(getSeries(4),3);
setFillType(getAnnotationBox(0),3);
setFillType(getChartBackground(),3);
-*
-* Set the display mode of you objects to either stretched or tiled
-*
setTextureDisplayMode(getSeries(0),0);
setTextureDisplayMode(getSeries(1),1);
setTextureDisplayMode(getSeries(2),1);
setTextureDisplayMode(getSeries(3),1);
setTextureDisplayMode(getSeries(4),0);

-*
-* Assign your images (textures) to the objects
-*
setTextureURL(getAnnotationBox(0),"/images/stuart/checkered.jpg");
setTextureURL(getChartBackground(),"/images/stuart/checkered.jpg");
setTextureURL(getSeries(0),"/images/stuart/vertical.jpg");
setTextureURL(getSeries(1),"/images/stuart/horizontal.jpg");
setTextureURL(getSeries(2),"/images/stuart/diaganol.jpg");
setTextureURL(getSeries(3),"/images/stuart/checkered.jpg");

setPlace(false);
ENDSTYLE
ON GRAPH SET STYLE *
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
TITLETEXT='Late Order Release High Level Product Performance',
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
JUSTIFY=CENTER,
$
ENDSTYLE
END


WebFocus 7.6.5
Windows
HTML (some Excel and PDF)
September 08, 2009, 06:54 AM
<JG>
quote:
/images/stuart/

Stuart as you're 7.6.5 try putting the images in /images/

Are you getting any errors returned?
September 08, 2009, 08:29 AM
Stuart
I have moved the files to that location and there is no change. There are no errors, the html is populated with the graph as a stacked bar graph, but the pictures are not pulled in. The only thing apparent is a white box in the top right hand corner.

Any other ideas?

Thanks,

Stu.


WebFocus 7.6.5
Windows
HTML (some Excel and PDF)
September 08, 2009, 09:19 AM
<JG>
The white box is the annotation.

I've tested the code (just changed it to use the car file and standard tdg images)
in both 7.6.6 and 7.6.9 and it works fine using both /images and /images/stuart

The only suspicion is that the location of the images is not correct

assuming that you have a bog standard install on the c drive the path should be

c:\ibi\WebFOCUS76\ibi_html\javaassist\images

You can see if the following runs if so that is the issue

 

GRAPH FILE CAR
SUM DEALER_COST
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH VBRSTK1
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 SET VAXIS 500
ON GRAPH SET HAXIS 900
ON GRAPH SET GRMERGE ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setFrameDisplay(false);
setRiserWidth(55);
setDataTextDisplay(true);
-*
-* Create the annotation box and
-*
setDisplay(getAnnotationBox(0), true);
setDisplay(getAnnotation(0), true);
setFontSize(getAnnotation(0),6);
setFontStyle(getAnnotation(0), 0);
setTextString(getAnnotation(0), " ");
setTransparentBorderColor(getAnnotationBox(0), false);
setRect(getAnnotation(0), new Rectangle (9000, 5000, 4800,10000));
-*
-* Set the fill type for objects that you want to contain images to texture
-*
setFillType(getSeries(0),3);
setFillType(getSeries(1),3);
setFillType(getSeries(2),3);
setFillType(getSeries(3),3);
setFillType(getSeries(4),3);
setFillType(getAnnotationBox(0),3);
setFillType(getChartBackground(),3);
-*
-* Set the display mode of you objects to either stretched or tiled
-*
setTextureDisplayMode(getSeries(0),0);
setTextureDisplayMode(getSeries(1),1);
setTextureDisplayMode(getSeries(2),1);
setTextureDisplayMode(getSeries(3),1);
setTextureDisplayMode(getSeries(4),0);

-*
-* Assign your images (textures) to the objects
-*
setTextureURL(getAnnotationBox(0),"/images/tdg/ColorTool.gif");
setTextureURL(getChartBackground(),"/images/tdg/Carrera_White.gif");
setTextureURL(getSeries(0),"/images/tdg/blue_tile.gif");
setTextureURL(getSeries(1),"/images/tdg/bricks.gif");
setTextureURL(getSeries(2),"/images/tdg/Azul_Granite.gif");
setTextureURL(getSeries(3),"/images/tdg/Icons.gif");

setPlace(false);
ENDSTYLE
ON GRAPH SET STYLE *
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
TITLETEXT='Late Order Release High Level Product Performance',
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
JUSTIFY=CENTER,
$
ENDSTYLE
END
 

September 08, 2009, 09:48 AM
GinnyJakes
I attempt to never add custom anything to any of the IBI-supplied directories as that tends to complicate upgrades. I have a functioning focexec that adds a texture to a bar graph using an image in approot:
setTextureURL(getSeries(0),"http://my_web_server/approot/ibidemo/bg2.jpg");



Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
September 08, 2009, 10:02 AM
<JG>
Ginny

That is always my preference as well, but there was a bug in 5.x.x and 7.1.x versions
which meant it would not work.

And I hate having to code absolute urls
September 08, 2009, 10:37 AM
GinnyJakes
quote:
And I hate having to code absolute urls

I agree. I don't think I could get it to work without but then I did it in a hurry awhile back for one of my users.

As for the bug, good to know.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
September 08, 2009, 10:39 AM
Stuart
Thanks both,

it was just the case that i had wrong file path.

All working now.

Thanks very much, very helpful.

regards,
Stu.


WebFocus 7.6.5
Windows
HTML (some Excel and PDF)