Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved]Show only the values in percentage on pie slice label

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved]Show only the values in percentage on pie slice label
 Login/Join
 
Gold member
posted
 
ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
GRAPH FILE CAR
-* Created by Info Assist for Graph
SUM COMPUTE CALC/D12.3 = WHEELBASE / 10;
BY MODEL
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setLegendPosition(1);
setBorderColor(getChartBackground(),new Color(255,255,255));
setReportParsingErrors(false);
setSelectionEnableMove(false);
setPieFeelerTextDisplay(0);
setFillColor(getChartBackground(),new Color(255,255,255,0));
setFillColor(getSeries(0),new Color(113,110,45));
setFillColor(getSeries(1),new Color(140,132,116));
setFillColor(getSeries(2),new Color(6,140,191));
setFillColor(getSeries(3),new Color(202,31,64));
setFillColor(getSeries(4),new Color(17,87,114));
setFillColor(getSeries(5),new Color(5,121,165));
setFillColor(getSeries(6),new Color(9,149,209));
setFillColor(getSeries(7),new Color(6,140,191));
setFillColor(getSeries(8),new Color(1,46,62));
setFillColor(getSeries(9),new Color(7,93,127));
setFillColor(getSeries(10),new Color(64,186,144));
setFillColor(getSeries(11),new Color(68,193,201));
setFillColor(getSeries(12),new Color(6,140,191));
setFillColor(getSeries(13),new Color(52,101,176));
setFillColor(getSeries(15),new Color(8,103,140));
setFillColor(getSeries(16),new Color(21,52,62));
setFillColor(getSeries(17),new Color(6,140,191));
setFillColor(getSeries(18),new Color(68,164,201));
setFillColor(getSeries(19),new Color(1,46,62));
setFillColor(getSeries(20),new Color(239,76,82));
setFillColor(getSeries(21),new Color(198,139,130));
setFillColor(getSeries(22),new Color(78,191,171));
setFillColor(getSeries(23),new Color(72,83,89));
setFillColor(getSeries(24),new Color(87,178,228));
setFillColor(getSeries(14), new Color(52,74,156,255));
setTextFormatPattern(getPieSliceLabel(),"##.#%");
*END
-RUN
ENDSTYLE
END


Intent is to show only CALC value in percentage as the tooltip on pie slice. Currently it shows the decimal value and percentage of pie slice it covers.

This message has been edited. Last edited by: Kartik Katyal,


WebFOCUS 8010,8204
Windows
 
Posts: 59 | Registered: June 26, 2015Report This Post
Virtuoso
posted Hide Post
This can be an option
TABLE FILE CAR
SUM COMPUTE CALC  /D12.3 = WHEELBASE / 10;
BY MODEL
ON TABLE HOLD AS DETDATA
END
-RUN

DEFINE FILE DETDATA
DUMMY /A1    = 'X';
END
TABLE FILE DETDATA
SUM COMPUTE CALC_TOT /D12.3 = CALC;
BY DUMMY
ON TABLE HOLD AS TOTCALC
END
-RUN
-READFILE TOTCALC
-RUN
-DEFAULTH &CALC_TOT = 0
-TYPE &CALC_TOT

TABLE FILE DETDATA
SUM COMPUTE CALC_TOT /D12.3 = &CALC_TOT;
    CALC
    COMPUTE PCT /P10.2C = IF CALC_TOT NE 0 THEN CALC / CALC_TOT * 100 ELSE 0;
BY MODEL
ON TABLE HOLD AS GRAPHDATA
END
-RUN

ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
GRAPH FILE GRAPHDATA
SUM CALC
    COMPUTE DIMX /A30V = MODEL;
    COMPUTE PCTX /A20V = LJUST(12, FPRINT(PCT, 'P10.2C', 'A12V'), 'A12V') || ' %';
BY MODEL
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setLegendPosition(1);
setBorderColor(getChartBackground(),new Color(255,255,255));
setReportParsingErrors(false);
setSelectionEnableMove(false);
setPieFeelerTextDisplay(0);
setFillColor(getChartBackground(),new Color(255,255,255,0));
setFillColor(getSeries(0),new Color(113,110,45));
setFillColor(getSeries(1),new Color(140,132,116));
setFillColor(getSeries(2),new Color(6,140,191));
setFillColor(getSeries(3),new Color(202,31,64));
setFillColor(getSeries(4),new Color(17,87,114));
setFillColor(getSeries(5),new Color(5,121,165));
setFillColor(getSeries(6),new Color(9,149,209));
setFillColor(getSeries(7),new Color(6,140,191));
setFillColor(getSeries(8),new Color(1,46,62));
setFillColor(getSeries(9),new Color(7,93,127));
setFillColor(getSeries(10),new Color(64,186,144));
setFillColor(getSeries(11),new Color(68,193,201));
setFillColor(getSeries(12),new Color(6,140,191));
setFillColor(getSeries(13),new Color(52,101,176));
setFillColor(getSeries(15),new Color(8,103,140));
setFillColor(getSeries(16),new Color(21,52,62));
setFillColor(getSeries(17),new Color(6,140,191));
setFillColor(getSeries(18),new Color(68,164,201));
setFillColor(getSeries(19),new Color(1,46,62));
setFillColor(getSeries(20),new Color(239,76,82));
setFillColor(getSeries(21),new Color(198,139,130));
setFillColor(getSeries(22),new Color(78,191,171));
setFillColor(getSeries(23),new Color(72,83,89));
setFillColor(getSeries(24),new Color(87,178,228));
setFillColor(getSeries(14), new Color(52,74,156,255));
setTextFormatPattern(getPieSliceLabel(),"##.#%");
*END
TYPE=DATA, COLUMN=MODEL, BUCKET=color, $
TYPE=DATA, COLUMN=CALC,  BUCKET=measure, $
TYPE=DATA, COLUMN=DIMX,  BUCKET=tooltip, $
TYPE=DATA, COLUMN=PCTX,  BUCKET=tooltip, $
*GRAPH_JS_FINAL
series: [ {"series": 'reset', "tooltip": '{{tooltip1}}<br>{{tooltip2}}'} ],
htmlToolTip: {enable: true, snap: false }
*END
ENDSTYLE
END
-RUN


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2410 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Master
posted Hide Post
You just need to format what you want on the tooltip in the JSON Properties for HTML5 Charts.

Docs here: Customize Tooltips and Data Labels

One caveat is that I had to divide your COMPUTE by an additional 100 to format the tooltip correctly
 
ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
GRAPH FILE CAR
-* Created by Info Assist for Graph
SUM COMPUTE CALC/D12.3 = WHEELBASE / 10 / 100;
BY MODEL
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setLegendPosition(1);
setBorderColor(getChartBackground(),new Color(255,255,255));
setReportParsingErrors(false);
setSelectionEnableMove(false);
setPieFeelerTextDisplay(0);
setFillColor(getChartBackground(),new Color(255,255,255,0));
setFillColor(getSeries(0),new Color(113,110,45));
setFillColor(getSeries(1),new Color(140,132,116));
setFillColor(getSeries(2),new Color(6,140,191));
setFillColor(getSeries(3),new Color(202,31,64));
setFillColor(getSeries(4),new Color(17,87,114));
setFillColor(getSeries(5),new Color(5,121,165));
setFillColor(getSeries(6),new Color(9,149,209));
setFillColor(getSeries(7),new Color(6,140,191));
setFillColor(getSeries(8),new Color(1,46,62));
setFillColor(getSeries(9),new Color(7,93,127));
setFillColor(getSeries(10),new Color(64,186,144));
setFillColor(getSeries(11),new Color(68,193,201));
setFillColor(getSeries(12),new Color(6,140,191));
setFillColor(getSeries(13),new Color(52,101,176));
setFillColor(getSeries(15),new Color(8,103,140));
setFillColor(getSeries(16),new Color(21,52,62));
setFillColor(getSeries(17),new Color(6,140,191));
setFillColor(getSeries(18),new Color(68,164,201));
setFillColor(getSeries(19),new Color(1,46,62));
setFillColor(getSeries(20),new Color(239,76,82));
setFillColor(getSeries(21),new Color(198,139,130));
setFillColor(getSeries(22),new Color(78,191,171));
setFillColor(getSeries(23),new Color(72,83,89));
setFillColor(getSeries(24),new Color(87,178,228));
setFillColor(getSeries(14), new Color(52,74,156,255));

*GRAPH_JS_FINAL
"pieProperties": {
"holeSize": "0%"
},
"riserBevel": "none",
"agnosticSettings": {
"chartTypeFullName": "Pie_Multi"
},
"series": [{
    "series": "reset",
    "tooltip": "{{series_label}}: {{value | formatNumber('#.###%')}}"
}]
*END
ENDSTYLE
END
-RUN
 

This message has been edited. Last edited by: Hallway,


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Gold member
posted Hide Post
Thanks guys for your help.


WebFOCUS 8010,8204
Windows
 
Posts: 59 | Registered: June 26, 2015Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved]Show only the values in percentage on pie slice label

Copyright © 1996-2020 Information Builders