Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Gauge Whole Numbers
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Gauge Whole Numbers
 Login/Join
 
Gold member
posted
Can anyone tell me how to only have whole number ticks on this chart? Thanks

GRAPH FILE IBISAMP/CAR
SUM CNT.CAR
WHERE COUNTRY EQ 'ENGLAND'
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET EMBEDHEADING ON
ON GRAPH SET LOOKGRAPH GAUGE1
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
TYPE=HEADING, JUSTIFY=CENTER, FONT='CALIBRI', SIZE=10, COLOR=RGB(0 0 0), STYLE=BOLD, $
TYPE=FOOTING, JUSTIFY=CENTER, FONT='CALIBRI', SIZE=8, COLOR=RGB(0 0 0), STYLE=BOLD, $
*GRAPH_SCRIPT
setCurveFitEquationDisplay(false);
setPlace(true);
setReportParsingErrors(false);
setSelectionEnableMove(false);
*END
ENDSTYLE
END

This message has been edited. Last edited by: FP Mod Chuck,


WF 8.0.08 (Prod); WF 8.2.04 (Dev)
 
Posts: 66 | Location: OK | Registered: November 19, 2015Reply With QuoteReport This Post
Master
posted Hide Post
try adding in setTextFormatPreset(getY1Label(),1);
 
GRAPH FILE IBISAMP/CAR
SUM CNT.CAR
WHERE COUNTRY EQ 'ENGLAND'
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET EMBEDHEADING ON
ON GRAPH SET LOOKGRAPH GAUGE1
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
TYPE=HEADING, JUSTIFY=CENTER, FONT='CALIBRI', SIZE=10, COLOR=RGB(0 0 0), STYLE=BOLD, $
TYPE=FOOTING, JUSTIFY=CENTER, FONT='CALIBRI', SIZE=8, COLOR=RGB(0 0 0), STYLE=BOLD, $
*GRAPH_SCRIPT
setCurveFitEquationDisplay(false);
setPlace(true);
setReportParsingErrors(false);
setSelectionEnableMove(false);
setTextFormatPreset(getY1Label(),1);
*END
ENDSTYLE
END


Hallway
WF(Prod):8202M1
WF(Test):8202M4
OS/Platform:Win 10
Outputs:All
 
Posts: 559 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Gold member
posted Hide Post
Thanks for the response. I tried that earlier, but then it gave me two marks on the dial for "1", two for "2", etc. I can't tell if the duplicate tick marks are major or minor ones...


WF 8.0.08 (Prod); WF 8.2.04 (Dev)
 
Posts: 66 | Location: OK | Registered: November 19, 2015Reply With QuoteReport This Post
Master
posted Hide Post
I found some really good docs on Gauge and Axis formatting here:


I am actually surprised on the amount of formatting that you can do to the guage chart.

Check out the code below:
  
GRAPH FILE ibisamp/car
SUM CNT.CAR.COMP.CAR/I11 AS 'Car Count'
WHERE CAR.ORIGIN.COUNTRY EQ 'ENGLAND';
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH GAUGE1
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setFillColor(getGaugeBand1(),new Color(255,0,0));
setFillColor(getGaugeBand2(),new Color(255,255,0));
setFillColor(getGaugeBand3(),new Color(255,255,0));
setFillColor(getGaugeBand4(),new Color(0,255,0));
setFillColor(getGaugeBand5(),new Color(0,255,0));
*GRAPH_JS_FINAL
"gaugeProperties": {
    "startAngle": 130,
    "endAngle": 50,
    "layout": "gauge",
    "groupLabel": {
        "visible": true,
        "font": "bold 5em Sans-Serif",
        "color": "black"
    },
    "totalLabel": {
        "visible": true,
        "font": "bold 30px Sans-Serif",
        "color": "DarkMagenta",
        "numberFormat": "auto"
    },
    "fill": {
        "color": "lightgray"
    },
    "needle": {
        "color": "DarkMagenta",
    },
    "needleBase": {
        "size": "7%",
        "color": "lightblue",
        "border": {
            "width": 5,
            "color": "darkblue",
            "dash": ""
        }
    },
    "axisWidth": "5%",
    "axisTickLength": "15%",
    "axisMinorTickLength": "10%",
    "outerBorder": {
        "shape": "tight",
        "width": "10%",
        "fill": {
            "color": "lightblue"
        },
        "border": {
            "width": 5,
            "color": "darkblue",
            "dash": ""
        }
    }
},
"yaxis": {
    "intervalMode": "interval",
    "intervalValue": 1,
    "numberFormat": "auto",
    "labels": {
        "font": "bold 30pt Sans-Serif",
        "color": "black"
    },
    "majorGrid": {
        "visible": true,
        "lineStyle": {
            "width": 4,
            "color": "black",
            "dash": ""
        },
    },
    "minorGrid": {
        "visible": true,
        "count": 1,
        "lineStyle": {
            "width": 1,
            "color": "darkgray",
            "dash": ""
        },
    }
},
"series": [{
    "series": 0,
    "color": "lightblue",
    "border": {
        "width": 2,
        "color": "darkblue",
        "dash": ""
    }
}]

*END
ENDSTYLE
END


Hallway
WF(Prod):8202M1
WF(Test):8202M4
OS/Platform:Win 10
Outputs:All
 
Posts: 559 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Gold member
posted Hide Post
Wow, lots of good stuff here. Thanks. Only problem is, it looks like any JSON I do doesn't happen. For instance, this is in your first link:

  
The following version of the request sets the gauge chart layout to 'simple':

GRAPH FILE WF_RETAIL_LITE
SUM COGS_US
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH GAUGE1
ON GRAPH SET STYLE *
*GRAPH_JS
"gaugeProperties": {"layout": "simple"}
*END
ENDSTYLE
END


The picture shows this nice graph with no needle and only a number in the middle. However when I run it, I get the same old graph format I've been getting. Any ideas? Thanks again.


WF 8.0.08 (Prod); WF 8.2.04 (Dev)
 
Posts: 66 | Location: OK | Registered: November 19, 2015Reply With QuoteReport This Post
Master
posted Hide Post
Weird. Maybe your version of WebFOCUS. Did you try it in your 8.2.04 Dev environment?


Hallway
WF(Prod):8202M1
WF(Test):8202M4
OS/Platform:Win 10
Outputs:All
 
Posts: 559 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Gold member
posted Hide Post
I actually don't have that environment right now so I can't test it, but I'll take your word for it.


WF 8.0.08 (Prod); WF 8.2.04 (Dev)
 
Posts: 66 | Location: OK | Registered: November 19, 2015Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Gauge Whole Numbers

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.