Focal Point
[CLOSED: Not Solved] Displaying negative values in () in Graph

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

April 30, 2009, 04:01 PM
DW Marker
[CLOSED: Not Solved] Displaying negative values in () in Graph
All,

I've searched and haven't been able to find a way to handle a user request for a graph. This graph will show % Changes versus a prior period, and therefore can have negative values. What the user wants is for the negative values to be displayed as (9.9%), as opposed to -9.9%. Can that be done? I am using standard graphs at this point.

This message has been edited. Last edited by: DW Marker,


WF 7.6.4
Windows XP and UNIX
April 30, 2009, 11:18 PM
Waz
What values are you trying to get to (9.9), the axis, tooltip, or something else ?

DEFINE FILE CAR
 PCTVAL/D6.2B = DECODE COUNTRY('ENGLAND' 5.5 'ITALY' -9.9 ELSE 0) ;
END
GRAPH FILE CAR
SUM PCTVAL
BY COUNTRY
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRAPHEDIT OFF
ON GRAPH SET GRAPHSTYLE *
setDataTextDisplay (true);
setTextFormatPreset(getSeries(0),-1);
setTextFormatPattern(getSeries(0),"#0.00'%';(#0.00'%)'");
setTextFormatPreset (getY1Label(), -1);
setTextFormatPattern (getY1Label(),"#0.00'%';(#0.00'%)'");
ENDSTYLE
END

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


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!

May 01, 2009, 10:52 AM
DW Marker
Okay, I can do the () around negative values, which I was doing for the Axis label and the data itself, which I had just about figured out when you posted. Now the question is can it be made red when it is negative? Since they want the numbers to appear a different color, not the bar?


WF 7.6.4
Windows XP and UNIX
May 04, 2009, 05:54 PM
Waz
I can't seem to find an answer to this that is simple. you may be able to do this with a dual axis bipolar graph, but I think it will be difficult.

Hope someone else has a better suggestion.


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!

May 05, 2009, 04:40 AM
<JG>
In theory you should simply be able to set the fill color using the following API calls
which you would have to pregenerate and -INCLUDE

setFillColor(getDataText(2), new Color(255,0,0));

However It does not work in 7.6.7 or 7.6.8.

You may be lucky and it might work in 7.6.4.

It seems to me that they have broken a lot of API calls recently

This message has been edited. Last edited by: <JG>,
May 06, 2009, 10:17 AM
DW Marker
Can I ask when you say I would have pregenerate and include that API call, is there a reason I'd have to do it that way, as opposed to just putting it in directly?

But either way we may end up opening a case on this as the user seems to really want this in there... Even changing the bar color doesn't make them totally happy. Darn end users!


WF 7.6.4
Windows XP and UNIX
May 06, 2009, 11:43 AM
<JG>
DW Marker

There are a number of examples on the forum about generating API calls and including them.

Basically you do a table request, hold the output, then do a -INCLUDE.

However the basic issue here is that the API calls do not work as documented.

That means you will need to raise a case with IBI and unfortunately may have to raise an NFR
which can mean a wait of several years if the ever deliver.

I think the user is going to disappointed on this one.
May 06, 2009, 11:53 AM
DW Marker
We are going to proceed with opening a case, and most likely an NFR also. Thanks for your input JG, it is much appreciated.


WF 7.6.4
Windows XP and UNIX
May 06, 2009, 05:50 PM
Waz
Good luck with the case and NFR.

As a point of reference, the graph functionality comes from http://www.threedgraphics.com/...va/documentation.php, they have online manuals, and describe everything. IBI have put a wrapper around the java app, and exposed most methods and properties.


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!