Focal Point
[CLOSED] Setting Gauge graph scale

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

June 10, 2010, 01:08 AM
Praven
[CLOSED] Setting Gauge graph scale
HI

How can I set gauge scale from 50 to 100? I have data ranges from 50 to 100 and I don't want to show the scale from 0 - 50. Please give me your thoughts to set scale from 50.

Webfocus 7.6.9,
Windows

This message has been edited. Last edited by: Kerry,
June 10, 2010, 01:38 AM
Waz
It would be a good idea for you to check up on the manuals.

There have been many posts about charting and where the documentation is.

setY1ScaleMin({value});
setY1ScaleMax({value});



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!

June 10, 2010, 02:28 AM
Praven
Thank you so much for posting the answer. I already tried that code but still scale is starting from 0. Below is my code with car file. Not sure why it is not starting from 10000 scale. Please share your thoughts.
GRAPH FILE CAR
SUM SALES AS ' '
ACROSS COUNTRY AS ' '
-*WHERE COUNTRY IN ('ENGLAND','ITALY','JAPAN','FRANCE')
-*WHERE STATUS EQ 'New'
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 500
ON GRAPH SET HAXIS 900
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setReportParsingErrors(false);
setSelectionEnableMove(false);
setGaugeMajorAutoStep(false);
setScaleFromZero(false);
setY1ScaleMin(10000);
setY1ScaleMax(90000);
-*setY1MinorGrid(70);
setGridStep(getY1MajorGrid(),10000.0);
setDisplay(getGaugeBand1(),true);
setDisplay(getGaugeBand2(),true);
setBorderColor(getGaugeBand1(),new Color(255,255,255));
setBorderColor(getGaugeBand2(),new Color(0,0,255));
setBorderColor(getGaugeBand3(),new Color(0,0,0));
setBorderColor(getGaugeBand4(),new Color(0,0,255));
setBorderColor(getGaugeBand5(),new Color(255,255,255));
setPiesPerRow(4);
setDisplay(getGaugeTitle(),true);
setGaugeTitlePosition(1);
setMarkerDisplay(true);
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setPlace(true);
setPlaceResize(getGaugeTitle(), 0);
setFillColor(getChartBackground(),new Color(255,255,255));
setFillColor(getGaugeNeedle(),new Color(255,255,255));
setTransparentFillColor(getGaugeArea(),false);
setGaugeIgnoreBackgroundStyle(true);
setGradientNumPins(getChartBackground(), 2);
setGradientPinPosition(getChartBackground(), 0.0,0);
setGradientPinPosition(getChartBackground(), 1.0,1);
setFillType(getChartBackground(), 1);
setGaugeBackgroundStyle(7);
setGradientPinLeftColor(getChartBackground(),new Color(255,255,255), 0);
setGradientPinRightColor(getChartBackground(),new Color(255,255,255), 0);
setFontName(getY1Label(),"Calibiri");
setFontSizeAbsolute(getY1Label(), true);
setFontSizeInPoints(getY1Label(), 4);
setFillColor(getGaugeValue(),new Color(192,192,192));
ENDSTYLE
END
-EXIT
June 10, 2010, 07:13 PM
Waz
Looks like this is a bug, as it works in 7.1.6, but does not in 7.6.9.

I would suggest putting in a case with IBI.


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!

June 11, 2010, 02:51 AM
M Meagher
I got it to work by substituting this code:

-*setScaleFromZero(false);
-*
setScaleMinAuto(getY1Axis(),false);
setScaleMin(getY1Axis(),10000);
setScaleMaxAuto(getY1Axis(),false);
setScaleMax(getY1Axis(),90000);
-*
-*setY1ScaleMin(10000);
-*setY1ScaleMax(90000);
-*setY1MinorGrid(70);

June 14, 2010, 05:36 PM
Waz
Awesome, your a graph expert, Good One


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!

June 15, 2010, 02:24 AM
Praven
Thank you so much for your answer. You are the expert Smiler. Meagher I have one more issue in this gauge graphs. As the band width colors are not working as expected. For the same car file when I divided the bands into 5 and with different colors these band colors are not coming properly. ((255 0 0) red
(0 255 0) Green
(255 255 0) Yellow).
Thank you so much for your time


GRAPH FILE CAR
SUM SALES AS ' '
ACROSS COUNTRY AS ' '
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 250
ON GRAPH SET HAXIS 500
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setReportParsingErrors(false);
setSelectionEnableMove(false);
setGaugeMajorAutoStep(false);
setScaleFromZero(false);
setScaleMinAuto(getY1Axis(),false);
setScaleMin(getY1Axis(),50000);
setScaleMaxAuto(getY1Axis(),false);
setScaleMax(getY1Axis(),90000);
setGridStep(getY1MajorGrid(),10000.0);
-*********************BAND COLORS*****************-
setDisplay(getGaugeBand1(),true);
setDisplay(getGaugeBand2(),true);
setDisplay(getGaugeBand3(),true);
setDisplay(getGaugeBand4(),true);
setDisplay(getGaugeBand5(),true);
setGaugeBandMin(getGaugeBand1(), 10000);
setGaugeBandMax(getGaugeBand1(), 20000);
setGaugeBandMin(getGaugeBand2(), 20000);
setGaugeBandMax(getGaugeBand2(), 30000);
setGaugeBandMin(getGaugeBand3(),30000.0);
setGaugeBandMax(getGaugeBand3(),40000.0);
setGaugeBandMin(getGaugeBand4(),40000.0);
setGaugeBandMax(getGaugeBand4(),60000.0);
setGaugeBandMin(getGaugeBand5(),60000.0);
setGaugeBandMax(getGaugeBand5(),90000.0);
setBorderColor(getGaugeBand1(),new Color(255,0,0));
setBorderColor(getGaugeBand2(),new Color(255,255,0));
setBorderColor(getGaugeBand3(),new Color(0,255,0));
setBorderColor(getGaugeBand4(),new Color(255,255,0));
setBorderColor(getGaugeBand5(),new Color(255,0,0));
-*********************END OF BAND COLORS*****************-
setPiesPerRow(4);
setDisplay(getGaugeTitle(),true);
setGaugeTitlePosition(1);
setMarkerDisplay(true);
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setPlace(true);
setPlaceResize(getGaugeTitle(), 0);
setFillColor(getChartBackground(),new Color(255,255,255));
setFillColor(getGaugeNeedle(),new Color(255,255,255));
setTransparentFillColor(getGaugeArea(),false);
setGaugeIgnoreBackgroundStyle(true);
setGradientNumPins(getChartBackground(), 2);
setGradientPinPosition(getChartBackground(), 0.0,0);
setGradientPinPosition(getChartBackground(), 1.0,1);
setFillType(getChartBackground(), 1);
setGaugeBackgroundStyle(7);
setGradientPinLeftColor(getChartBackground(),new Color(255,255,255), 0);
setGradientPinRightColor(getChartBackground(),new Color(255,255,255), 0);
setFontName(getY1Label(),"Calibiri");
setFontSizeAbsolute(getY1Label(), true);
setFontSizeInPoints(getY1Label(), 4);
setFillColor(getGaugeValue(),new Color(192,192,192));
ENDSTYLE
END
June 16, 2010, 03:53 PM
M Meagher
You should add setFillColor also:

-*********************BAND COLORS*****************-
setDisplay(getGaugeBand1(),true);
setDisplay(getGaugeBand2(),true);
setDisplay(getGaugeBand3(),true);
setDisplay(getGaugeBand4(),true);
setDisplay(getGaugeBand5(),true);
setGaugeBandMin(getGaugeBand1(),10000.0);
setGaugeBandMax(getGaugeBand1(),50000.0);
setGaugeBandMin(getGaugeBand2(),50000.0);
setGaugeBandMax(getGaugeBand2(),60000.0);
setGaugeBandMin(getGaugeBand3(),60000.0);
setGaugeBandMax(getGaugeBand3(),70000.0);
setGaugeBandMin(getGaugeBand4(),70000.0);
setGaugeBandMax(getGaugeBand4(),80000.0);
setGaugeBandMin(getGaugeBand5(),80000.0);
setGaugeBandMax(getGaugeBand5(),90000.0);
setBorderColor(getGaugeBand1(),new Color(255,0,0));
setBorderColor(getGaugeBand2(),new Color(255,255,0));
setBorderColor(getGaugeBand3(),new Color(0,255,0));
setBorderColor(getGaugeBand4(),new Color(255,128,64));
setBorderColor(getGaugeBand5(),new Color(255,0,0));
setFillColor(getGaugeBand1(),new Color(255,0,0));
setFillColor(getGaugeBand2(),new Color(255,255,0));
setFillColor(getGaugeBand3(),new Color(0,255,0));
setFillColor(getGaugeBand4(),new Color(255,128,64));
setFillColor(getGaugeBand5(),new Color(255,0,0));
-*********************END OF BAND COLORS*****************-

This message has been edited. Last edited by: M Meagher,
June 16, 2010, 04:13 PM
M Meagher
No expert here. I just have a similar gauge application which shows the voltages of our UPS's at our remote field sites. Anything below 12.8 volts triggers an email message with the gauge graphs from the three remote sites. I could just send the voltage, but the gauges look cooler!

I just pasted Praven's code into a focexec, opened it in Advanced Graph Assistant (7.6.11) and made the changes he wanted.
June 16, 2010, 05:14 PM
Dan Satchell
quote:
No expert here

Mike, that's never been my view point of your skills.


WebFOCUS 7.7.05