Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graph axis display ... number format 1

Status
Not open for further replies.

Wayster

Technical User
Feb 2, 2004
3
0
0
GB
Help !
I've just started learning to use WebFOCUS 436 and need to plot some dual Y axis bar/line combination graphs with
X axis = week number
Y1 axis (line)= "affected %"
Y2 axis (bar) = "total number"

I have been able to produce the necessary graphs quite easily using the WebFOCUS graphing tool, but I can't find a way to change the formats of the Y axis scales to give the desired format :

Y1 axis (line)= "affected %"
desired format : displayed to 3 decimal places eg. 10.241%)
current format : integer
(raw data already has 3 decimal places)

Y2 axis (bar) = "total number"
desired format : displayed as integer eg 50000 or 50K
current format : displayed as integer e.g 50K
(raw data is already integer)

Currently, the Y2 axis appears correctly but I cannot change the format of the Y1 axis to give what I need.

If I use the format option in the Graphing tool, it changes to X.XX%, but also automatically multiplies my data by 100 when it assigns the '%' symbol. This is a problem, as my data is already in % format (i.e. doesnt need to be multiplied by 100) and I don't want to have to divide my original data by 100 to account for this recalculation by WebFOCUS.

So, my questions :
1) Can anyone help me to display the Y1 axis to 3 decimal places without changing the format of the Y2 axis ?
2) How do you add an axis label instead of relying on graph legends alone ? Ideally, I want to show the Y1 axis data as X.XXX and have a label on the axis reading 'Affected %'. Is this possible ?

Any help would be much appreciated !!!
 
Hi Wayster,

No doubt you have solved this by now, but just in case below is some text from a document I compiled for my own WebFOCUS users on Graphing. This gives the code required to enter into the edit text screen. To control the Y2 axis just change Y1 to Y2. As for controlling Axis titles, I have also included some text on this also from my own guide. Note there is a manual called something like graphing API which covers all this. The manual I compiled just takes the most common changes we need to make to graphs were I work and covers them in 'real' english.

Regards

Tewy

Changing Number format on Axis

setTextFormatPreset(getY1Label(), -1);
setTextFormatPattern(getY1Label(), “00.0”);

The first line tells Focus to set the Y1 label display to the user specified value. The second line tells Focus to set the pattern to 1 decimal space. The format can also be defined as ##.#, the difference being

00.0 will display 16.0 as 16.0
##.# will display 16.0 as 16

This command is particularly important when graphing data that sits below 1 (i.e. 0.99 and below) as Focus generally defaults to showing value below 0.5 as 0 and value above 0.5 as 1. Hence a graph with Y values of 0.2 0.4 0.6 0.8 would be displayed as 0 0 1 1 without the settings above.

Displaying Axis Titles (Instead of Fieldnames)

setY1TitleDisplay(true);
setY1TitleString(“Value”);

The first line tells Focus to display an axis title on the Y1 Axis. The second line sets the value of this title to the word Value. This can also be used for the Ordinate axis by replacing Y1 with O1 thus

setO1TitleDisplay(true);
setO1TitleString(“Week”);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top