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. 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 myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved]Colors for each slice in PIE graph

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved]Colors for each slice in PIE graph
 Login/Join
 
Gold member
posted
I have a pie graph in which i'm mentioning the colors for each slice.
But I'm not getting the mentioned color for only one of the slice.

Here is the sample code:

GRAPH FILE CAR
SUM DEALER_COST AS ''
BY CAR
WHERE CAR EQ 'BMW' OR 'MASERATI' OR 'JAGUAR'
HEADING CENTER
"Car Pie Graph"

ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 200
ON GRAPH SET VAXIS 200
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIESINGL
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET GRAPHSTYLE *
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(5);
setTransparentBorderColor(getSeries(0),true);
setTransparentBorderColor(getSeries(1),true);
setTransparentBorderColor(getSeries(2),true);
setTransparentBorderColor(getSeries(3),true);
setPieDepth(10);
setPlace(true);
setPieLabelDisplay(3);
setDisplay(getLegendArea(),false);
setOtherPieLabelDisplay(3);
setFontName(getTitle(),"SansSerif");
setFillColor(getTitle(),new Color(32,0,32));
setFontStyle(getTitle(),2);
setFontSizeAbsolute(getTitle(),true);
setFontSizeInPoints(getTitle(),10);
setPlaceResize(getTitle(),0);
setTextWrap(getPieLabel(),true);
setGradientDirection(getSeries(0),9);
setFillType(getSeries(0),1);
setFillColor(getSeries(1),new Color(#FFFF00));
setFillColor(getSeries(2),new Color(#0000FF));
setFillColor(getSeries(3),new Color(#008000));
setFontSizeAbsolute(getPieSliceLabel(),true);
setFontSizeInPoints(getPieSliceLabel(),8);
setPlaceResize(getPieSliceLabel(),0);
setFontSizeAbsolute(getPieLabel(),true);
setFontSizeInPoints(getPieLabel(),8);
setPlaceResize(getPieLabel(),0);
setFillColor(getSeries(0),new Color(118,101,188));
setFontStyle(getPieSliceLabel(),0);
setFontStyle(getPieLabel(),0);
setTransparentBorderColor(getChartBackground(),false);
setPieFeelerTextDisplay(1);
setRect(getPieFrame(),new Rectangle(-15520.0,-13672.0,36373.0,26084.0));
setTextString(getSubtitle(),"\n\n\n");
setTextString(getTitle()," \n");
setDisplay(getTitle(),true);
ENDSTYLE
ON GRAPH SET STYLE *
TYPE=HEADING, LINE=1, ITEM=1, OBJECT=TEXT, SIZE=10, STYLE=BOLD, FONT='ARIAL', JUSTIFY=CENTER, $
ENDSTYLE
END

RESULT:
--------
I have given three colors for my graph:Yellow, Blue, Green

But the result is not showing Green color alone. Is there any way to get all the three mentioned colors???

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


WebFocus Version 7.7.05
Windows, HTML/PDF/EXL2K/AHTML
 
Posts: 63 | Registered: January 12, 2011Report This Post
Gold member
posted Hide Post
Every time i get violet color in my graph, irrespective of no.of slices in pie graph.....

If there is only one slice in pie graph, then its in same violet color. Tht color is appearing in all circumstances....

Is this the default color? Hw can we avoid in that case?


WebFocus Version 7.7.05
Windows, HTML/PDF/EXL2K/AHTML
 
Posts: 63 | Registered: January 12, 2011Report This Post
Virtuoso
posted Hide Post
Remove this line - it sets the color for the first slice to purple.

setFillColor(getSeries(0),new Color(118,101,188));

Also, change the series numbers from 1,2,3 to 0,1,2 in the other setFillColor statements.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
Thank you Dan Satchell ....Its working now.

In addition to this, whether specific coloring for specific slice is possible?

Like for 'BMW' - Blue color, 'MASERATI' - Yellow, 'JAGUAR' - Green

How this can be achieved?


WebFocus Version 7.7.05
Windows, HTML/PDF/EXL2K/AHTML
 
Posts: 63 | Registered: January 12, 2011Report This Post
Gold member
posted Hide Post
Yeah...I got the solution for this...I included the below code in style part:

ON GRAPH SET STYLE *
TYPE=DATA,COLOR=BLUE,WHEN=N1 EQ 'BMW', $
TYPE=DATA,COLOR=YELLOW,WHEN=N1 EQ 'MASERATI', $
TYPE=DATA,COLOR=GREEN,WHEN=N1 EQ 'JAGUAR', $
ENDSTYLE

Its working fine....Any other way or suggestions are always welcome.....


WebFocus Version 7.7.05
Windows, HTML/PDF/EXL2K/AHTML
 
Posts: 63 | Registered: January 12, 2011Report 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     [Solved]Colors for each slice in PIE graph

Copyright © 1996-2020 Information Builders