Has any one been able to add a reference line to a guage chart?
I have been asked to display 2 values on the same gauge chart.
Here is one try of many.
GRAPH FILE MVAL SUM MVAL.MVAL.DISPLAYVALUE AS '' ACROSS MVAL.MVAL.DISPLAYNAME HEADING "Active Values" ON GRAPH SET LOOKGRAPH GAUGE1 ON GRAPH SET GRAPHEDIT SERVER ON GRAPH SET BARNUMB OFF ON GRAPH SET 3D OFF ON GRAPH SET VZERO ON ON GRAPH SET GRID ON ON GRAPH SET VAXIS 145 ON GRAPH SET HAXIS 325 ON GRAPH PCHOLD FORMAT PNG ON GRAPH SET GRAPHSTYLE * setDisplay(getGaugeTitle(),false); setGaugeBandMax(getGaugeBand1(), 100); setGaugeBackgroundStyle(5); setGaugeRelativeThickness(0.20); setY1ScaleMax(100.0); setFillColor(getGaugeBand1(), new Color(0,255,0)); setFillColor(getGaugeBand2(), new Color(0,255,0)); setFillColor(getGaugeBand3(), new Color(0,255,0)); setFillColor(getGaugeBand4(), new Color(255,255,0)); setFillColor(getGaugeBand5(), new Color(255,0,0)); setFillColor(getGaugeNeedle(), new Color(0,0,0)); setGaugeNeedleStyle(5); setDisplay(getFootnote(), true); setAutofit(getFootnote(), false); setMarkerDisplay(true); setConnectLineMarkers(false); setConnectScatterMarkers(false); setO1LabelDisplay(true); setO1AxisSide(0); setO1MajorGridDisplay(true); setO1MajorGridStyle(0); setO1MinorGridDisplay(false); setAxisAssignment(0,0); setY1LabelDisplay(true); setY1AxisSide(0); setY1MajorGridDisplay(true); setY1MajorGridStyle(0); setY1MinorGridDisplay(false); setTextFormatPreset(getY1Label(),-1); setTextFormatPattern(getY1Label(),"#.##"); setPieFeelerTextDisplay(1); setPieLabelDisplay(0); setTextFormatPreset(getPieSliceLabel(),1); setRiserBorderMode(1); setSeriesDefaultTransparentBorderColor(true); setUseSeriesBorderDefaults(true); setLegendDisplay(true); setFootnoteString("MVAL"); setTextJustHoriz(getFootnote(),1); setFontSizeAbsolute(getFootnote(),true); setFontSize(getFootnote(),10); setFontStyle(getFootnote(),0); setTextRotation(getFootnote(),0); setTextWrap(getFootnote(),false); setFontSizeAbsolute(getY1Title(),true); setFontSizeAbsolute(getY1Label(),true); setFontSizeAbsolute(getY2Title(),true); setFontSizeAbsolute(getY2Label(),true); setFontSizeAbsolute(getO1Title(),true); setPlaceResize(getFootnote(),0); setPlaceRotate(getFootnote(),0); setPlaceAlign(getFootnote(),0); setPlaceWordWrap(getFootnote(),0); setPlace(true); setReferenceLine (getGaugeArea(), 0, 50); setLineWidth (getReferenceLine (getGaugeArea(), 0), 20); setFillColor (getReferenceLine (getGaugeArea(), 0), new Color (255, 0, 0)); ENDSTYLE ON GRAPH SET STYLE * PAGESIZE='Letter', LEFTMARGIN=0.250000, RIGHTMARGIN=0.250000, TOPMARGIN=0.250000, BOTTOMMARGIN=0.250000, SQUEEZE=ON, ORIENTATION=PORTRAIT, $ TYPE=REPORT, GRAPHCOLOR='WHITE', $ TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=8, BACKCOLOR='NONE', STYLE=NORMAL, $ TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=1, COLOR='BLACK', $ TYPE=FOOTING, LINE=1, OBJECT=TEXT, ITEM=1, FONT='TIMES NEW ROMAN', SIZE=10, $ ENDSTYLE END
Fernando WF 7.1.3
Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
June 26, 2007, 02:43 PM
Kerry
Hi Fernando,
Our graph expert reviewed this and would like to know more details from you. Reference lines are mostly used on X,Y charts and most likely not supported on circular charts.
Hope this helps.
Cheers,
Kerry
Kerry Zhan Focal Point Moderator Information Builders, Inc.
July 04, 2007, 04:26 PM
Fernando
Kerry,
I have a gauge chart that show our current value. I wish to show the previous value as well. I was hoping to plot the 2 lines but gauge charts do not allow you to do that. Using a reference line was another option. I did try adding a sort field and then merging data with no luck either.
Fernando v 7.13
Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
July 05, 2007, 09:09 AM
<JG>
Fernando, the only option you have is to simulate the situation using the gaugebands.
Remember that the bands logically should go up ie 0-60 60-80 80-100 in your case. However an interesting feature, may be a bug, is that if you assign lower values they will overlay.
So calculate your previous value save it and read it into a variable. Create a second variable = that value +1 and pass this into the code for the band values.
Nearest your going to get I think
-SET &OLDVALUEL=66; -SET &OLDVALUEU=&OLDVALUEL +1; GRAPH FILE CAR SUM COMPUTE DISPLAYVALUE/D9=77; AS '' ACROSS COUNTRY HEADING "Active Values" WHERE COUNTRY EQ 'ENGLAND' ON GRAPH SET LOOKGRAPH GAUGE1 ON GRAPH SET GRAPHEDIT SERVER ON GRAPH SET BARNUMB OFF ON GRAPH SET 3D OFF ON GRAPH SET VZERO ON ON GRAPH SET GRID ON ON GRAPH PCHOLD FORMAT PNG ON GRAPH SET GRAPHSTYLE * setDisplay(getGaugeTitle(),false); setGaugeBandMin(getGaugeBand1(), 0); setGaugeBandMax(getGaugeBand1(), 60); setGaugeBandMin(getGaugeBand2(), 60); setGaugeBandMax(getGaugeBand2(), 80); setGaugeBandMin(getGaugeBand3(), 80); setGaugeBandMax(getGaugeBand3(), 100); setGaugeBandMin(getGaugeBand4(), &OLDVALUEL); setGaugeBandMax(getGaugeBand4(), &OLDVALUEU); setGaugeBackgroundStyle(5); setGaugeRelativeThickness(0.20); setY1ScaleMax(100.0); setFillColor(getGaugeBand1(), new Color(0,255,0)); setFillColor(getGaugeBand2(), new Color(255,255,0)); setFillColor(getGaugeBand3(), new Color(255,0,0)); setFillColor(getGaugeBand4(), new Color(0,0,255)); setFillColor(getGaugeNeedle(), new Color(0,0,0)); setGaugeNeedleStyle(5); setDisplay(getFootnote(), true); setAutofit(getFootnote(), false); setMarkerDisplay(true); setConnectLineMarkers(false); setConnectScatterMarkers(false); setO1LabelDisplay(true); setO1AxisSide(0); setO1MajorGridDisplay(true); setO1MajorGridStyle(0); setO1MinorGridDisplay(false); setAxisAssignment(0,0); setY1LabelDisplay(true); setY1AxisSide(0); setY1MajorGridDisplay(true); setY1MajorGridStyle(0); setY1MinorGridDisplay(false); setTextFormatPreset(getY1Label(),-1); setTextFormatPattern(getY1Label(),"#.##"); setPieFeelerTextDisplay(1); setPieLabelDisplay(0); setTextFormatPreset(getPieSliceLabel(),1); setRiserBorderMode(1); setSeriesDefaultTransparentBorderColor(true); setUseSeriesBorderDefaults(true); setLegendDisplay(true); setFootnoteString("MVAL"); setTextJustHoriz(getFootnote(),1); setFontSizeAbsolute(getFootnote(),true); setFontSize(getFootnote(),10); setFontStyle(getFootnote(),0); setTextRotation(getFootnote(),0); setTextWrap(getFootnote(),false); setFontSizeAbsolute(getY1Title(),true); setFontSizeAbsolute(getY1Label(),true); setFontSizeAbsolute(getY2Title(),true); setFontSizeAbsolute(getY2Label(),true); setFontSizeAbsolute(getO1Title(),true); setPlaceResize(getFootnote(),0); setPlaceRotate(getFootnote(),0); setPlaceAlign(getFootnote(),0); setPlaceWordWrap(getFootnote(),0); setPlace(true);
ENDSTYLE ENDThis message has been edited. Last edited by: <JG>,
July 05, 2007, 10:18 AM
mgrackin
JG,
That's pretty slick! Nice suggestion.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
July 05, 2007, 02:46 PM
Fernando
JG,
This works really well.
Thanks!
Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
July 05, 2007, 02:55 PM
<JG>
Pleased it helps.
I suggest you check with IBI that it's actually a feature and not a bug, as it may disappear/stop working at some future date depending on the whims of the programming department.