Focal Point Banner


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.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Custom Coloring Not Working!!!!

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Custom Coloring Not Working!!!!
 Login/Join
 
Silver Member
posted
Hi Gurus,

I am trying to change the color of the bars in a Bar chart, as per client requirement.

I have pasted the Graph Bar Chart's code as well as the Style Sheet code where I am trying to make the change to achieve it.
So far all I have been able to do is change the color of all bars in the cart. But what I want is based on the value of the Dimension (X-Axis value) the color should change. I have put statements like in the style sheet (Code pasted below)

"TYPE=DATA, COLOR=RED,$ TYPE=DATA, COLUMN=AGENCY, COLOR=BLACK, WHEN=AGENCY EQ 'A01',$
TYPE=DATA, COLUMN=AGENCY, COLOR=BLUE, WHEN=AGENCY EQ 'A02',$".
But it does not work. It only changes the color to RED for all bars. It is not using the where conditions.

Please help! Thank you!

====== Graph Code =======

-*Do not delete or modify the comments below
*-INTERNAL_COMMENT LINE#0$PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+DQo8IS0tMS4wLS0+PFJvb3QgdmVyc2lvbj0iMS4wIj4NCiAgICA8T2JqZWN0IG9iamVjdElkPSJDaGFydF8xIj4NCi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JlZS5WSUVXX0RJTVM8L0VudHJ5Pg0KICAgICAgICA8L1Byb3BlcnR5Pg0KICAgICAgICA8UHJvcGVydHkgbmFtZT0iZW5hYmxlUHJldmlldyIgdHlwZT0iamF2YS5sYW5nLkJvb2xlYW4iPnRydWU8L1Byb3BlcnR5Pg0KICAgIDwvT2JqZWN0Pg0KPC9Sb290Pg0K
-*Do not delete or modify the comments above
ENGINE INT CACHE SET ON


-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';

-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE mdartrptapp/VW_SAMPLE_DATA
-* Created by Info Assist for Graph
SUM VW_SAMPLE_DATA.VW_SAMPLE_DATA.ACTUAL_VALUE
BY VW_SAMPLE_DATA.VW_SAMPLE_DATA.AGENCY
WHERE VW_SAMPLE_DATA.VW_SAMPLE_DATA.COMPONENT_ID EQ 1;
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET ARGRAPHENGIN JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET STYLE *


*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);

*END
INCLUDE=IBFS:/WFC/Repository/SAMPLE/Sandeep_Dev/CUSTOM_STY.sty,$

*GRAPH_SCRIPT

setReportParsingErrors(false);
setSelectionEnableMove(false);

*END

ENDSTYLE
END

-RUN
======== =====================

========Style Sheet code =================
$ Copyright 1996-2011 Information Builders, Inc. All rights reserved.
type=report,color=rgb(66 70 73),font='Trebuchet MS',size=9,grid=off,$
type=pagenum, style=italic, size=6, justify=right,$
type=tabheading,style=bold+italic,size=14,justify=center,$
type=tabfooting,style=bold+italic,size=12,justify=center,border-top=heavy, border-top-color=rgb(52 55 58),$
type=heading,style=bold,size=12,justify=center,$
type=footing,style=bold,size=10,justify=center,$
type=title,backcolor=rgb(102 102 102),color=rgb(255 255 255),style=-underline+bold,$
type=data, backcolor=(rgb(255 255 255) rgb(235 235 240)),$
type=acrosstitle, border-top=light, border-bottom=heavy, border-top-color=rgb(52 55 58), border-bottom-color=rgb(52 55 58), size=9, style=-underline+bold,$
type=acrossvalue,backcolor=rgb(218 225 232),style=bold,$
type=subhead,size=10,style=bold,border-top=heavy, border-bottom=light, border-top-color=rgb(52 55 58), border-bottom-color=rgb(52 55 58),$
type=subfoot,size=10,style=bold,border-top=light, border-bottom=medium, border-top-color=rgb(52 55 58), border-bottom-color=rgb(52 55 58),$
type=subtotal,backcolor=RGB(200 200 200),style=bold,border-top=light,border-top-color=rgb(66 70 73),$
type=grandtotal,backcolor=rgb(66 70 73),color=rgb(255 255 255),style=bold,border-top=light,border-bottom=heavy,border-top-color=rgb(66 70 73),
border-top-style=solid,border-bottom-style=double,$
TYPE=DATA, COLOR=RED,$
TYPE=DATA, COLUMN=AGENCY, COLOR=BLACK, WHEN=AGENCY EQ 'A01',$
TYPE=DATA, COLUMN=AGENCY, COLOR=BLUE, WHEN=AGENCY EQ 'A02',$

*GRAPH_SCRIPT
setFillColor(getSeries(0),new Color(48,94,213));
setFillColor(getSeries(1),new Color(237,195,27));
setFillColor(getSeries(2),new Color(136,144,151));
setFillColor(getSeries(3),new Color(140,205,40));
setFillColor(getSeries(4),new Color(227,136,0) );
setFillColor(getSeries(5),new Color(40,190,205) );
setFillColor(getSeries(6),new Color(255,102,102) );
setFillColor(getSeries(7), new Color(71,186,143));
setFillColor(getSeries(8), new Color(187,90,71));
setFillColor(getSeries(9),new Color(190,107,211));
setFillColor(getSeries(10),new Color(16,122,22));
setFillColor(getSeries(11),new Color(108,149,200));
setFillColor(getSeries(12),new Color(169,109,205) );
setFillColor(getSeries(13),new Color(210,143,255) );
setFillColor(getSeries(14),new Color(60,49,36));
setFillColor(getSeries(15),new Color(78,43,37));
setFillColor(getSeries(16),new Color(95,38,37));
setFillColor(getSeries(17),new Color(19,23,162));
setFillColor(getSeries(18),new Color(66,70,73));
setFillColor(getSeries(19),new Color(19,23,162));
setFillColor(getSeries(20),new Color(66,70,73));
setFillColor(getSeries(21),new Color(191,218,170));
setFillColor(getSeries(22),new Color(0,0,128));
setFillColor(getSeries(23),new Color(163,211,208));
setFillColor(getSeries(24),new Color(158,213,243));
setFillColor(getSeries(25),new Color(179,151,191));
setFillColor(getSeries(26),new Color(200,158,193));
setFillColor(getSeries(27),new Color(240,171,196));
setFillColor(getSeries(28),new Color(242,171,168));
setFillColor(getSeries(29),new Color(230,121,88));
setFillColor(getSeries(30),new Color(240,159,97));
setFillColor(getSeries(31),new Color(248,191,106));
setFillColor(getSeries(32),new Color(255,239,121));
setFillColor(getSeries(33),new Color(195,218,125));
setFillColor(getSeries(34),new Color(0,0,255));
setFillColor(getSeries(35),new Color(0,255,0));
setFillColor(getSeries(36),new Color(255,0,255));
setFillColor(getSeries(37),new Color(255,255,0));
setFillColor(getSeries(38),new Color(255,0,0));
setFillColor(getSeries(39),new Color(255,200,0));
setFillColor(getSeries(40),new Color(255,175,175));
setFillColor(getSeries(41),new Color(0,255,255));
setFillColor(getSeries(42),new Color(206,0,54));
setFillColor(getSeries(43),new Color(255,239,0));
setFillColor(getSeries(44),new Color(0,152,82));
setFillColor(getSeries(45),new Color(0,174,227));
setFillColor(getSeries(46),new Color(42,19,109));
setFillColor(getSeries(47),new Color(206,0,121));
setFillColor(getSeries(48),new Color(243,169,136));
setFillColor(getSeries(49),new Color(248,190,145));
setFillColor(getSeries(50),new Color(253,211,154));
setFillColor(getSeries(51),new Color(255,243,172));
setFillColor(getSeries(52),new Color(217,229,171));
setFillColor(getSeries(53),new Color(191,218,170));
setFillColor(getSeries(54),new Color(165,208,169));
setFillColor(getSeries(55),new Color(163,211,208));
setFillColor(getSeries(56),new Color(158,213,243));
setFillColor(getSeries(57),new Color(179,151,191));
setFillColor(getSeries(58),new Color(200,158,193));
setFillColor(getSeries(59),new Color(240,171,196));
setFillColor(getSeries(60),new Color(242,171,168));
setFillColor(getSeries(61),new Color(230,121,88));
setFillColor(getSeries(62),new Color(240,159,97));
setFillColor(getSeries(63),new Color(248,191,106));
setBorderColor(getO1AxisLine(),new Color(130,130,130));
setBorderColor(getY1AxisLine(),new Color(130,130,130));
setFillColor(getY1Title(),new Color(66,70,73));
setFillColor(getY1Label(),new Color(66,70,73));
setFillColor(getY2Label(),new Color(66,70,73));
setFillColor(getY3Label(),new Color(66,70,73));
setFillColor(getY4Label(),new Color(66,70,73));
setFillColor(getY5Label(),new Color(66,70,73));
setFillColor(getO1Title(),new Color(66,70,73));
setFillColor(getX1Title(),new Color(66,70,73));
setFillColor(getO1Label(),new Color(66,70,73));
setFillColor(getO2Label(),new Color(66,70,73));
setFillColor(getX1Label(),new Color(66,70,73));
setFillColor(getLegendText(),new Color(66,70,73));
setFillColor(getFrame(),new Color(235,235,240));
setFillColor(getChartBackground(),new Color(255,255,255));
setBorderColor(getY1MajorGrid(),new Color(204,204,204));
setBorderColor(getY1MinorGrid(),new Color(204,204,204));
setBorderColor(getY2MajorGrid(),new Color(204,204,204));
setBorderColor(getY2MinorGrid(),new Color(204,204,204));
setBorderColor(getO1MajorGrid(),new Color(204,204,204));
setBorderColor(getO1MinorGrid(),new Color(204,204,204));
setBorderColor(getX1MajorGrid(),new Color(204,204,204));
setBorderColor(getX1MinorGrid(),new Color(204,204,204));
setTransparentBorderColor(getCubeFloor(),true);
setTransparentBorderColor(getCubeLeftWall(),true);
setTransparentBorderColor(getCubeRightWall(),true);
setCubeFocusFactor(95.83333182119424);
setCubePanX(41.3);
setCubePanY(54.7);
setCubeRotationMatrix(0.9527877123115605,-0.39648905742363183,1.0691265903653806,-0.012240167246073914,1.389589570659449,0.5262420232508634,-1.1402128823990627,-0.3462324595884829,0.8877371966710723);
setCubeViewerZ(93.61645050038162);
setCubeZoomFactor(55.0);
setCubeWallThickZ(0.0);
setCubeWallThickY(0.0);
setCubeWallThickX(0.0);
setTransparentBorderColor(getSeries(0),true);
setTransparentBorderColor(getSeries(1),true);
setTransparentBorderColor(getSeries(2),true);
setTransparentBorderColor(getSeries(3),true);
setTransparentBorderColor(getSeries(4),true);
setTransparentBorderColor(getSeries(5),true);
setTransparentBorderColor(getSeries(6),true);
setTransparentBorderColor(getSeries(7),true);
setTransparentBorderColor(getSeries(8),true);
setTransparentBorderColor(getSeries(9),true);
setTransparentBorderColor(getSeries(10),true);
setTransparentBorderColor(getSeries(11),true);
setTransparentBorderColor(getSeries(12),true);
setTransparentBorderColor(getSeries(13),true);
setTransparentBorderColor(getSeries(14),true);
setTransparentBorderColor(getSeries(15),true);
setTransparentBorderColor(getSeries(16),true);
setTransparentBorderColor(getSeries(17),true);
setTransparentBorderColor(getChartBackground(),true);
setPieDepth(70);
setPieFeelerTextDisplay(4);
setY1MajorGridStyle(0);
setY2MajorGridStyle(0);
setO1MajorGridStyle(0);
setX1MajorGridStyle(0);
setLineStyleLegendMarkers(3);
setNullLegendMarkerShapesAsSquares(false);
setFrameAutoShade(true);
setColorMode(1);
setUseDefaultBubbleMarker(false);
*END
=================== ============================

This message has been edited. Last edited by: <Emily McAllister>,


WebFocus 8.1 Service Pack 0.5
Build Version branch8105
Build/GEN Number 119

OS/Platform: Apache Tomcat/8.0.21
 
Posts: 46 | Location: Baltimore | Registered: October 27, 2016Report This Post
Virtuoso
posted Hide Post
Is this may suit your need ?
-INCLUDE IBFS:/WFC/Repository/baseapp/set_bar_color.fex
-RUN
ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE car
-* Created by Info Assist for Graph
SUM CAR.BODY.DEALER_COST
BY CAR.ORIGIN.COUNTRY NOPRINT
BY CAR.ORIGIN.COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR
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);
-MRNOEDIT -INCLUDE baseapp/bar_color.fex
*END
ENDSTYLE
END
-RUN


-* File: IBFS:/goodfellow/WFC/Repository/baseapp/set_bar_color.fex Created by WebFOCUS AppStudio
SET ASNAMES = ON

-DEFAULTH &NBCNTRY = 0
-DEFAULTH &CNTRY   = ''

TABLE FILE CAR
BY COUNTRY AS 'CNTRY'
ON TABLE HOLD AS CNTRYCNT FORMAT BINARY
END
-RUN

-SET &NBCNTRY = &LINES;
-SET &I       = 1;
-SET &Y       = 0;
-SET &FIL     = 'BAR_COLOR' || '.fex';

FILEDEF BARCOLOR DISK baseapp/&FIL
END
-RUN
-WRITE BARCOLOR NOCLOSE -* Start Of File : baseapp/&FIL
-RUN

-IF &NBCNTRY EQ 0 THEN GOTO NOCOLOR;

-* LOOP FOR COUNTRY
-REPEAT NEXTCNTRY FOR &I FROM 1 TO &NBCNTRY STEP 1
-READFILE CNTRYCNT
-RUN
-TYPE CNTRY : &CNTRY

-SET &Y       = &I - 1;

-IF &CNTRY EQ 'ENGLAND'   THEN GOTO ENG;
-IF &CNTRY EQ 'FRANCE'    THEN GOTO FRA;
-IF &CNTRY EQ 'ITALY'     THEN GOTO ITA;
-IF &CNTRY EQ 'JAPAN'     THEN GOTO JAP;
-IF &CNTRY EQ 'W GERMANY' THEN GOTO GER;

-ENG
-WRITE BARCOLOR NOCLOSE setFillColor(getSeries(&Y.EVAL),new Color(128,0,0));
-GOTO NEXTCNTRY;
-FRA
-WRITE BARCOLOR NOCLOSE setFillColor(getSeries(&Y.EVAL),new Color(0,128,0));
-GOTO NEXTCNTRY;
-ITA
-WRITE BARCOLOR NOCLOSE setFillColor(getSeries(&Y.EVAL),new Color(0,0,128));
-GOTO NEXTCNTRY;
-JAP
-WRITE BARCOLOR NOCLOSE setFillColor(getSeries(&Y.EVAL),new Color(128,128,0));
-GOTO NEXTCNTRY;
-GER
-WRITE BARCOLOR NOCLOSE setFillColor(getSeries(&Y.EVAL),new Color(128,128,128));
-NEXTCNTRY

-NOCOLOR
-WRITE BARCOLOR NOCLOSE -* End Of File : baseapp/&FIL
-RUN


Pay attention to:
...
BY CAR.ORIGIN.COUNTRY NOPRINT
...
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
...
-MRNOEDIT -INCLUDE baseapp/bar_color.fex

You need to make the graph "think" that there is more than one measure, then you'll be able to give them their own color. So by creating a sub-grouping of your data it's like if you have multiple measures because it's now the "grouping" that is "colored".

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


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Silver Member
posted Hide Post
Thank you very much for your response Martin!
As I am new to WebFocus, I am trying to understand and modify the code that you suggested, to work in my case. I will get back to you.

Thank you very much again!


WebFocus 8.1 Service Pack 0.5
Build Version branch8105
Build/GEN Number 119

OS/Platform: Apache Tomcat/8.0.21
 
Posts: 46 | Location: Baltimore | Registered: October 27, 2016Report This Post
Silver Member
posted Hide Post
Martin,

I am new to focus language but have some programming background.I see you have used the below piece of code.
FILEDEF BARCOLOR DISK baseapp/&FIL END -RUN -WRITE BARCOLOR NOCLOSE -* Start Of File : baseapp/&FIL -RUN
I am amusing this some how saves a file/hold file. Can you tell me why do we need this? Can the program not execute the values color requirements without using "&FIL" varuable?


WebFocus 8.1 Service Pack 0.5
Build Version branch8105
Build/GEN Number 119

OS/Platform: Apache Tomcat/8.0.21
 
Posts: 46 | Location: Baltimore | Registered: October 27, 2016Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Custom Coloring Not Working!!!!

Copyright © 1996-2020 Information Builders