Conditional Graph Hover Text



Conditional Graph Hover Text

By Warren Hinchliffe
Problem:

Started from a question on Focal Point:

I have a v-bar graph showing two columns each for 12 months... for the first six months i need a particular hover text and for the second six months it will need need a different hover text...

The problem is that, all the values are from the same two columns and sorting across the month column..

GRAPH FILE   FIN_DATA
SUM
ACTUALS AS 'ACTUALS'
FORECASTS AS 'FORECASTS'
BY MONTH   COLUMNS 'JAN' AND 'FEB' .....

The hover text for the actuals is ACTUALS JAN+VALUE etc and similar for forecast... but from jun onwards I need the hover text to change from "Actuals ... " to "60 day ...." based on a condition?

Is this possible?




Solution:

Here is an example code to help resolving the issue.

It has a User Tooltip, and something slightly different for highlighting sections of the chart.


GRAPH   FILE EMPLOYEE
   SUM    CNT.EMP_ID
ACROSS HIRE_DATE
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRAPHEDIT OFF
ON GRAPH SET GRAPHSTYLE *  

-* User Tooltip
setToolTipMode(false);
setUserToolTip("Object Name:[ON][R]Object ID:[OID][R]Object Instance:[OIN]
[R]Object Description:[OD][R]Series Label:[SL][R]Group Label:[GL]
[R]X Value:[XV][R]Y Value:[YV][R]Z Value:[ZV]");   

-* Alternate Frames
setDisplay(getO1AltFmtFrame(), true);
setAltFmtFrameNumColors(getO1AltFmtFrame(), 2);
setAltFmtFrameSeparator(getO1AltFmtFrame(0), 5.0);
setDisplay(getO1AltFmtFrame(0), true);
setDisplay(getO1AltFmtFrame(1), true);
setFillColor(getO1AltFmtFrame(0), new Color(255,221,221));
setFillColor(getO1AltFmtFrame(1), new Color(221,255,221));   

-* Annotation 1
setDisplay(getAnnotation(0), true);
setTextString(getAnnotation(0), "Jan-Jun");
setFillColor(getAnnotation(0), new Color(128,0,0));
setRect(getAnnotation(0),new Rectangle(-14000,11000,9000,1800));
setFontSizeAbsolute(getAnnotation(0),true);
setFontSizeInPoints(getAnnotation(0),15.0);   

-* Annotation 2
setDisplay(getAnnotation(1), true);
setTextString(getAnnotation(1), "Jul-Dec");
setFillColor(getAnnotation(1), new Color(0,128,0));
setRect(getAnnotation(1),new Rectangle(0,11000,15000,1800));
setFontSizeAbsolute(getAnnotation(1),true);
setFontSizeInPoints(getAnnotation(1),15.0);
ENDSTYLE
END

If you want the User Tooltips, GRAPHEDIT needs to be set to OFF.

If any questions, please contact Warren at warren.hinchliffe@linkmarketservices.com.au.