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     [SOLVED] two colours for one line in a graph

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] two colours for one line in a graph
 Login/Join
 
Platinum Member
posted
Hi

Does anyone know how to change the colour of a line in a line graphs depending on the values? for example, make the line red when negative and black when positive... so one line can be either or both colours in the same graph? I know how to change the colour of a line of course but can't figure out how to get two colours.



Thanks.

Jodye

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


WF 8.0.0.5M
 
Posts: 246 | Location: Montreal, QC, Canada | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
Jodye

You have to create a graph with two lines
one for the positive values and one for the negative.
If you do that, the first version will give you some strange lines whenever the value switches from plus to minus.
The trick is to handle the null values (not zero!).
This is documented in the manuals.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Platinum Member
posted Hide Post
Hi Frank

I was just thinking something like that but thought that there must be an easier way. I looked and did not find anything I will search again.

thx.


WF 8.0.0.5M
 
Posts: 246 | Location: Montreal, QC, Canada | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
If you find an easier way please post it!




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Platinum Member
posted Hide Post
Hi Frank

I opened a case and got a great solution. Here is a sample with CAR...works perfectly. How come nobody seems to know about this? Smiler

Jodye

  
GRAPH FILE car
SUM SALES
BY COUNTRY
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET STYLE *
DEFMACRO=COND0001, MACTYPE=RULE, WHEN=SALES LT 20000, $
DEFMACRO=COND0002, MACTYPE=RULE, WHEN=SALES GE 20000, $
TYPE=DATA, MACRO=COND0001, COLUMN=SALES, STYLE=BOLD, COLOR=LIME, $
TYPE=DATA, MACRO=COND0002, COLUMN=SALES, COLOR=RED, $
ENDSTYLE
END 


WF 8.0.0.5M
 
Posts: 246 | Location: Montreal, QC, Canada | Registered: October 01, 2003Report This Post
Expert
posted Hide Post
quote:
How come nobody seems to know about this?

Perhaps the reason is because it doesn't work in 7.1, but does in 7.6.

I assume this functionality became available in 7.6.

In 7.1 the graph language created is

setGraphType(41);
setTextRotation(getO1Label(),2);
setTextRotation(getO2Label(),2);
setTextRotation(getX1Label(),2);
setFontSizeVC(getDataText(),1000);
setFontSizeVC(getFootnote(),1000);
setFontSizeVC(getLegendText(),1000);
setFontSizeVC(getO1Label(),1000);
setFontSizeVC(getO1Title(),1000);
setFontSizeVC(getO2Label(),1000);
setFontSizeVC(getO2Title(),1000);
setFontSizeVC(getPieLabel(),1000);
setFontSizeVC(getPieRingLabel(),1000);
setFontSizeVC(getPieSliceLabel(),1000);
setFontSizeVC(getSubtitle(),1000);
setFontSizeVC(getTitle(),1000);
setFontSizeVC(getX1Label(),1000);
setFontSizeVC(getX1Title(),1000);
setFontSizeVC(getY1Axis(),1000);
setFontSizeVC(getY1Label(),1000);
setFontSizeVC(getY1Title(),1000);
setFontSizeVC(getY2Label(),1000);
setFontSizeVC(getY2Title(),1000);
setToolTipDisplay(true);
setSeriesLabelArray(
"SALES"); 
setDataSeries(
12000.00,
0.00,
30200.00,
78030.00,
88190.00);
setDataRangeToExtent();
setGroupLabelArray(
"ENGLAND",
"FRANCE",
"ITALY",
"JAPAN",
"W GERMANY");
setY1MajorGridStyle(3);
setO1MajorGridStyle(3);
setDecimalNotation(".");
setCentZero(false);
setDataTextPosition(0);
setDataTextRadiusDefault(10);
setCustomDataText(getSeries(0), true);
setTextFormatPreset(getSeries(0),-1);
setTextFormatPattern(getSeries(0),"###,###");
setY1TitleString("SALES");
setO1TitleString("COUNTRY");
setFillColor(getSeries(0),new Color(0,255,0));
setFillColor(getSeries(1),new Color(0,255,0));
setFillColor(getSeries(2),new Color(255,0,0));
setFillColor(getSeries(3),new Color(255,0,0));
setFillColor(getSeries(4),new Color(255,0,0));



In 7.6 the graph language created is
setGraphType(41);
setTextRotation(getO1Label(),2);
setTextRotation(getO2Label(),2);
setTextRotation(getX1Label(),2);
setFontSizeVC(getDataText(),1000);
setFontSizeVC(getFootnote(),1000);
setFontSizeVC(getLegendText(),1000);
setFontSizeVC(getO1Label(),1000);
setFontSizeVC(getO1Title(),1000);
setFontSizeVC(getO2Label(),1000);
setFontSizeVC(getO2Title(),1000);
setFontSizeVC(getPieLabel(),1000);
setFontSizeVC(getPieRingLabel(),1000);
setFontSizeVC(getPieSliceLabel(),1000);
setFontSizeVC(getSubtitle(),1000);
setFontSizeVC(getTitle(),1000);
setFontSizeVC(getX1Label(),1000);
setFontSizeVC(getX1Title(),1000);
setFontSizeVC(getY1Axis(),1000);
setFontSizeVC(getY1Label(),1000);
setFontSizeVC(getY1Title(),1000);
setFontSizeVC(getY2Label(),1000);
setFontSizeVC(getY2Title(),1000);
setToolTipDisplay(true);
setSeriesLabelArray(
"SALES");
setDataSeries(
12000.00,
0.00,
30200.00,
78030.00,
88190.00);
setDataRangeToExtent();
setGroupLabelArray(
"ENGLAND",
"FRANCE",
"ITALY",
"JAPAN",
"W GERMANY");
setY1MajorGridStyle(3);
setO1MajorGridStyle(3);
setDecimalNotation(".");
setCentZero(false);
setDataTextPosition(0);
setDataTextRadiusDefault(10);
setCustomDataText(getSeries(0), true);
setTextFormatPreset(getSeries(0),-1);
setTextFormatPattern(getSeries(0),"###,###");
setY1TitleString("SALES");
setO1TitleString("COUNTRY");
setExceptionalRiser(0,0);
setFillColor(getExceptionalRiser(0,0),new Color(0,255,0));
setExceptionalRiser(0,1);
setFillColor(getExceptionalRiser(0,1),new Color(0,255,0));
setExceptionalRiser(0,2);
setFillColor(getExceptionalRiser(0,2),new Color(255,0,0));
setExceptionalRiser(0,3);
setFillColor(getExceptionalRiser(0,3),new Color(255,0,0));
setExceptionalRiser(0,4);
setFillColor(getExceptionalRiser(0,4),new Color(255,0,0));


It seems that in 7.1 code tried to produce the multi coloured line, but created different colours for each series, there is only one.
In 7.6 it uses the ExceptionalRiser method. This method is normally used for bar graphs, ten point to IBI for finding this out.

If anyone is interested, here is a link to ThreedGrephics that details this method. ExceptionalRiser


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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] two colours for one line in a graph

Copyright © 1996-2020 Information Builders