Focal Point
[SOLVED] Data values in a line graph

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

February 29, 2012, 05:22 AM
ferran
[SOLVED] Data values in a line graph
Hi,

I have a line graph with data values. So I have
setDisplay(getDataText(),true);
.

This shows a value for each X axis value. Instead, I need to show only first and last value. I know it's possible to show/hide data values for individual series, i.e.
setDisplay(gestDataText(0),true 
and so on, but I am not able to show only the two values mentioned.

I've tried with
setDisplay(getDataText(0,1),true);
but doesn't work.

Any suggestions?

Thank's in advice.

Ferran

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


WF 7.7.03,Win XP Pro.
HTML, PDF, EXCEL, AHTML, FLEX, APDF.
SQL Server, MySQL, DB2, FOCUS.
February 29, 2012, 03:47 PM
Waz
Looks like it doesn't support it.

What does the documentation say ?


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!

February 29, 2012, 03:51 PM
ebaig
quote:
setDisplay(getDataText(0,1),true);


The numbers for getDataText are for the series, not the data points.

If you know what the first and last values are of the graph, you could try something like this:

  
GRAPH FILE CAR
SUM 
    COMPUTE A/D18.2=IF COUNTRY EQ 'ENGLAND' THEN DEALER_COST ELSE -1 ;
    COMPUTE B/D18.2=IF COUNTRY EQ 'W GERMANY' THEN DEALER_COST ELSE -1 ;
    DEALER_COST
 BY COUNTRY
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(0);
setUseSeriesShapes(true);
setMarkerSizeDefault(50);
setTransparentBorderColor(getChartBackground(),true);
setPlace(true);
setDisplay(getDataText(0),true);
setDisplay(getDataText(),true);
setDisplay(getDataText(2),false);
setDisplay(getLegendArea(),false);
setY1ScaleMinAuto(false);
setY1ScaleMin(0.0);
setY1OffScaleDisplay(false);
ENDSTYLE
END


Essentially you can add additional data lines on your graph, and display the data values on those lines. The last 3 graph statements cover up unnecessary data points:
 setY1ScaleMinAuto(false);
setY1ScaleMin(0.0);
setY1OffScaleDisplay(false);
 


If you don't know the first and last value, then you could do another call to your table and place the min and max values in two parameters


WebFOCUS 77, Windows, HTML PDF EXCEL
March 01, 2012, 03:04 AM
ferran
Waz,

The documentation says:

getDataText()
This method returns the object ID of a graph's data text.
Syntax:
IdentObj getDataText();
IdentObj getDataText(int s, int g);

where:
s
Is a series number.
g
Is a group number.

It seem's that the only way to do that is by ebaig's suggestion.

Thank's!


WF 7.7.03,Win XP Pro.
HTML, PDF, EXCEL, AHTML, FLEX, APDF.
SQL Server, MySQL, DB2, FOCUS.
March 01, 2012, 04:23 AM
ferran
It works ebaig, thank you very much!. It will be this a nice new feauture in next WF versions? Smiler


WF 7.7.03,Win XP Pro.
HTML, PDF, EXCEL, AHTML, FLEX, APDF.
SQL Server, MySQL, DB2, FOCUS.
March 01, 2012, 10:51 AM
ferran
Hi again,

One suggestion about ebaig's solution. If you change your compute statements using missing values:
COMPUTE A/D18.2 MISSING ON=IF COUNTRY EQ 'ENGLAND' THEN DEALER_COST ELSE MISSING ;
COMPUTE B/D18.2 MISSING ON=IF COUNTRY EQ 'W GERMANY' THEN DEALER_COST ELSE MISSING;


You have no need to use
setY1OffScaleDisplay(false);


Best regards,


WF 7.7.03,Win XP Pro.
HTML, PDF, EXCEL, AHTML, FLEX, APDF.
SQL Server, MySQL, DB2, FOCUS.