Focal Point
[solved] max value line in line graph

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

February 23, 2012, 02:20 PM
Krishna
[solved] max value line in line graph
I have a line graph created in Advanced Graph Assistant.

GRAPH FILE EMPDATA
SUM SALARY
BY HIREDATE
END

How do I get a second line on the graph that is a straight horizintal line where the maximum salary is? This line would be as long as the graph is wide.

Krishna

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


Version: 7.7.3
Windows 7
PDF, Excel, HTML
February 23, 2012, 02:25 PM
<JG>
check the graph API doc's

look for Reference line.

Requires a pre graph step to get the value and assign it to a variable that can be put into the API call
February 23, 2012, 02:29 PM
Keith MacDonald
This might also be helpful:

http://www.threedgraphics.com/...rogrammer/pfj_08.htm


WebFOCUS & DataMigrator 7.7.03M
Windows 2003, Windows 2008 x64
February 23, 2012, 02:36 PM
<JG>
Generally you should not refer to the 3dG documentation (was the case many years ago).

IBI owns the rights to modify the source and so It's documentation should be used.

For most calls it is the same,
BUT IBI has enhanced quite a number of items and also not implemented some.
February 23, 2012, 03:52 PM
Waz
The documentation in 3dg is also 12 years old, but sometimes helpful.


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 23, 2012, 04:23 PM
<FreSte>
...?


TABLE FILE EMPDATA
  SUM 
    MAX.SALARY/I9
  ON TABLE SET HOLDLIST PRINTONLY
  ON TABLE HOLD FORMAT ALPHA
END
-RUN
-READ HOLD,&MAX_SAL


GRAPH FILE EMPDATA
  SUM 
    SALARY
    COMPUTE MAXSAL/I9 = &MAX_SAL; AS ''
  BY HIREDATE
  ON TABLE SET GRAPHSTYLE *
  setGraphType(17);
  setSeriesType(getSeries(0), 1);
  setSeriesType(getSeries(1), 2);
  setDataLineThickness(1);
  setMarkerDisplay(false);
  ENDSTYLE
END

February 23, 2012, 04:51 PM
Waz
quote:
...?


Confused


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 23, 2012, 04:56 PM
<FreSte>
It's my shortcut for "Maybe something like this ?" Wink
February 23, 2012, 05:03 PM
Waz
Big Grin


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 27, 2012, 02:39 AM
Danny-SRL
It is necessary to sum the salaries by HIREDATE, then to locate the max salary and finally to display the graph:
  
-* File KRISHNA01.fex
SET ASNAMES=ON
TABLE FILE EMPDATA
SUM SALARY
BY HIREDATE
ON TABLE HOLD AS K1
END
TABLE FILE K1
SUM MAX.SALARY AS MAXSALARY
SUM SALARY
BY HIREDATE
ON TABLE HOLD AS K2
END
-RUN
GRAPH FILE K2
-* Created by Advanced Graph Assistant
SUM K2.K2.SALARY
K2.K2.MAXSALARY
BY K2.K2.HIREDATE
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 VBAR
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(5);
setTransparentBorderColor(getChartBackground(),true);
setTransparentBorderColor(getSeries(0),true);
setTransparentBorderColor(getSeries(1),true);
setTransparentBorderColor(getSeries(2),true);
setTransparentBorderColor(getSeries(3),true);
setTransparentBorderColor(getSeries(4),true);
setTransparentBorderColor(getSeries(5),true);
setTransparentBorderColor(getSeries(6),true);
setTransparentBorderColor(getSeries(7),true);
setTransparentBorderColor(getSeries(8),true);
setTransparentBorderColor(getSeries(9),true);
setTransparentBorderColor(getSeries(10),true);
setPlace(true);
setSeriesType(getSeries(1),2);
ENDSTYLE
END




Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

February 27, 2012, 01:58 PM
Krishna
I had done something similar late Friday with a

SUM FST.SALARY
BY HIREDATE

in the first pass, so that each date would have one value, and the max salary line would touch the top of the max salary series, rather than go through it in places.

The approach of not using variables allows you to bring this back into the Advanced Graph Assistant to do more formatting.

Thank you.


Version: 7.7.3
Windows 7
PDF, Excel, HTML