Focal Point
[CLOSED] Gauge Whole Numbers

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

January 15, 2020, 04:03 PM
evan.brown
[CLOSED] Gauge Whole Numbers
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.06 (Dev)
January 15, 2020, 08:47 PM
Hallway
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

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
January 16, 2020, 08:49 AM
evan.brown
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.06 (Dev)
January 16, 2020, 06:32 PM
Hallway
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

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
January 17, 2020, 09:04 AM
evan.brown
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.06 (Dev)
January 17, 2020, 11:51 AM
Hallway
Weird. Maybe your version of WebFOCUS. Did you try it in your 8.2.04 Dev environment?


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
January 21, 2020, 08:47 AM
evan.brown
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.06 (Dev)