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     [NFR] show more info in the map chart data label
Go
New
Search
Notify
Tools
Reply
  
[NFR] show more info in the map chart data label
 Login/Join
 
Gold member
posted
i am unable to show more info in the data labels in the map chart .
below is the code for my map chart. when i enable the data label, it shows only the sum field information but i want to show the county(by field) in the data label.


i am able to control the tooltip to show more info but not the data label.



*-INTERNAL_COMMENT LINE#1$ICAgICAgICAgIDxFbnRyeSBrZXk9ImRlZmF1bHRfY29tcG9zZV9mb3JtYXQiIHR5cGU9ImphdmEubGFuZy5TdHJpbmciPkFIVE1MPC9FbnRyeT4KICAgICAgICAgICAgPEVudHJ5IGtleT0iZGlzcGxheVJlc291cmNlc0ZpZWxkVGFiSW5mb01pbmlQcmVmZXJlbmNlIiB0eXBlPSJqYXZhLmxhbmcuU3RyaW5nIj5mYWxzZTwvRW50cnk+CiAgICAgICAgICAgIDxFbnRyeSBrZXk9ImRpc3BsYXlGb3JtYXRUYWJJbmZvTWluaVByZWZlcmVuY2UiIHR5cGU9ImphdmEubGFuZy5TdHJpbmciPnRydWU8L0VudHJ5PgogICAgICAgIDwvUHJvcGVydHk+CiAgICAgICAgPFByb3BlcnR5IG5hbWU9ImNhc2NhZGVOYW1lcyIgdHlwZT0iTWFwIi8+CiAgICAgICAgPFByb3BlcnR5IG5hbWU9Ik1hc3Rlcl9GaWxlcyIgdHlwZT0iU2V0Ij4KICAgICAgICAgICAgPEVudHJ5IHR5cGU9ImphdmEubGFuZy5TdHJpbmciPkZBVEFMQ01QMjwvRW50cnk+CiAgICAgICAgPC9Qcm9wZXJ0eT4KICAgICAgICA8UHJvcGVydHkgbmFtZT0ibWV0YWRhdGFWaWV3QXMiIHR5cGU9Ik1hcCI+CiAgICAgICAgICAgIDxFbnRyeSBrZXk9IkZBVEFMQ01QMiIgdHlwZT0iamF2YS5sYW5nLlN0cmluZyI+TWV0YURhdGFUcmVlLlZJRVdfRElNUzwvRW50cnk+CiAgICAgICAgPC9Qcm9wZXJ0eT4KICAgICAgICA8UHJvcGVydHkgbmFtZT0iR2Vvcm9sZXMiIHR5cGU9Ik1hcCI+CiAgICAgICAgICAgIDxFbnRyeSBrZXk9IkZBVEFMQ01QMi5TRUcwMS5DT1VOVFlfTkFNRSIgdHlwZT0iamF2YS5sYW5nLlN0cmluZyI+VVNDT1VOVFk8L0VudHJ5PgogICAgICAgICAgICA8RW50cnkga2V5PSJGQVRBTENNUDIuU0VHMDEuU3RhdGVfTmFtZSIgdHlwZT0iamF2YS5sYW5nLlN0cmluZyI+VVNTVEFURTwvRW50cnk+CiAgICAgICAgPC9Qcm9wZXJ0eT4KICAgICAgICA8UHJvcGVydHkgbmFtZT0iR2VvZm9ybWF0cyIgdHlwZT0iTWFwIj4KICAgICAgICAgICAgPEVudHJ5IGtleT0iRkFUQUxDTVAyLlNFRzAxLkNPVU5UWV9OQU1FIiB0eXBlPSJqYXZhLmxhbmcuU3RyaW5nIj5OQU1FPC9FbnRyeT4KICAgICAgICAgICAgPEVudHJ5IGtleT0iRkFUQUxDTVAyLlNFRzAxLlN0YXRlX05hbWUiIHR5cGU9ImphdmEubGFuZy5TdHJpbmciPk5BTUU8L0VudHJ5PgogICAgICAgIDwvUHJvcGVydHk+CiAgICAgICAgPFByb3BlcnR5IG5hbWU9ImVuYWJsZVByZXZpZXciIHR5cGU9ImphdmEubGFuZy5Cb29sZWFuIj50cnVlPC9Qcm9wZXJ0eT4KICAgIDwvT2JqZWN0Pgo8L1Jvb3Q+Cg==
-*Do not delete or modify the comments above
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE FATALCMP2
-* Created by Info Assist for Graph
SUM COMPUTE CmpCNTYCOLOR/I8=IF Diff_Crash_Cnt LT 0 THEN 1 ELSE IF Diff_Crash_Cnt EQ 0 THEN 2 ELSE IF Diff_Crash_Cnt GT 0 THEN 3 ; AS 'Color'
FATALCMP2.SEG01.Crash_CntYr2 AS 'CurrYr-2'
FATALCMP2.SEG01.Crash_CntYr1 AS 'CurrYr-1'
FATALCMP2.SEG01.Diff_Crash_Cnt
BY FATALCMP2.SEG01.COUNTY_NAME AS 'County'
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET AUTOFIT ON
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH CHOROPLETH
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENWarm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, CHART-LOOK=com.esri.map, $
TYPE=DATA, COLUMN=N2, BUCKET=color, DRILLMENUITEM='Detail Report', TARGET='_blank', FOCEXEC=IBFS:/WFC/Repository/InfoApps/CRASH/Procedure/Crash_Fatality_Cmp_Rpt_Drill.fex(COUNTY_NAME=COUNTY_NAME), DRILLMENUITEM='Detail Chart', TARGET='_blank', FOCEXEC=IBFS:/WFC/Repository/InfoApps/CRASH/Procedure/Crash_Fatality_Cmp_Ch_Drill.fex(COUNTY_NAME=COUNTY_NAME), $
TYPE=DATA, COLUMN=N3, BUCKET=tooltip, $
TYPE=DATA, COLUMN=N4, BUCKET=tooltip, $
TYPE=DATA, COLUMN=N5, BUCKET=tooltip, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDisplay(getLegendArea(),false);
setDisplay(getDataText(0), true);
setDataTextDisplay(true);
*GRAPH_JS_FINAL
"extensions": {
"com.esri.map": {
"overlayLayers": [
{
"ibiDataLayer": {
"map-location": {
"map_by_field": "FATALCMP2.SEG01.COUNTY_NAME",
"parameters": [
{
"parm_field": "FATALCMP2.SEG01.COUNTY_NAME",
"parm_georole": "USCOUNTY"
},
{
"parm_field": "FATALCMP2.SEG01.State_Name",
"parm_georole": "USSTATE"
}
],
"returned_georole": "USCOUNTY"
}
}
}
],
"baseMapInfo": {
"customBaseMaps": [
{
"ibiBaseLayer": "gray"
}
]
}
}
},
"pieProperties": {
"holeSize": "0%"
},
"agnosticSettings": {
"chartTypeFullName": "Choropleth"
}
*END

*GRAPH_JS_FINAL
"series": [
{series: 'reset', tooltip: function(v, s, g, data) {
return '' +
'County : ' + data.name.split( '|' ).shift() + '
' +
'Current Yr Count : ' + data.tooltip1 + '
' +
'Prev Yr Count : ' + data.tooltip2 + '
' +
'Difference in Count : ' + data.tooltip3 + '
';
}},
],
*END

ENDSTYLE
END
-RUN

-*IA_GRAPH_FINISH
-RUN

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


WebFOCUS 8
Windows, All Outputs
 
Posts: 62 | Registered: January 23, 2018Reply With QuoteReport This Post
Gold member
posted Hide Post
https://drive.google.com/open?...y3YuRHQk7xBLhHEE_PO3

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


WebFOCUS 8
Windows, All Outputs
 
Posts: 62 | Registered: January 23, 2018Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Try with the following
Not tested since I don't have your data. You may need to adjust some stuff.
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE FATALCMP2
-* Created by Info Assist for Graph
SUM COMPUTE CmpCNTYCOLOR/I8=IF Diff_Crash_Cnt LT 0 THEN 1 ELSE IF Diff_Crash_Cnt EQ 0 THEN 2 ELSE IF Diff_Crash_Cnt GT 0 THEN 3 ; AS 'Color'
FATALCMP2.SEG01.Crash_CntYr2 AS 'CurrYr-2'
FATALCMP2.SEG01.Crash_CntYr1 AS 'CurrYr-1'
FATALCMP2.SEG01.Diff_Crash_Cnt

    COMPUTE TT1 /A30V = 'County : ' | COUNTY_NAME;
    COMPUTE TT2 /A40V = 'Current Yr Count : ' | FPRINT(Crash_CntYr1, 'P10C',  'A12V');
    COMPUTE TT3 /A40V = 'Prev Yr Count : '    | FPRINT(Crash_CntYr2, 'P10C',  'A12V');
    COMPUTE TT4 /A40V = 'Difference in Count : ' | FPRINT(Diff_Crash_Cnt, 'P10C',  'A12V');

BY FATALCMP2.SEG01.COUNTY_NAME AS 'County'
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET AUTOFIT ON
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH CHOROPLETH
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENWarm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, CHART-LOOK=com.esri.map, $
TYPE=DATA, COLUMN=N2, BUCKET=color, DRILLMENUITEM='Detail Report', TARGET='_blank', FOCEXEC=IBFS:/WFC/Repository/InfoApps/CRASH/Procedure/Crash_Fatality_Cmp_Rpt_Drill.fex(COUNTY_NAME=COUNTY_NAME), DRILLMENUITEM='Detail Chart', TARGET='_blank', FOCEXEC=IBFS:/WFC/Repository/InfoApps/CRASH/Procedure/Crash_Fatality_Cmp_Ch_Drill.fex(COUNTY_NAME=COUNTY_NAME), $

TYPE=DATA, COLUMN=N6, BUCKET=tooltip, $
TYPE=DATA, COLUMN=N7, BUCKET=tooltip, $
TYPE=DATA, COLUMN=N8, BUCKET=tooltip, $
TYPE=DATA, COLUMN=N9, BUCKET=tooltip, $

*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDisplay(getLegendArea(),false);
setDisplay(getDataText(0), true);
setDataTextDisplay(true);
*GRAPH_JS_FINAL
"extensions": {
 "com.esri.map": {
 "overlayLayers": [
 {
 "ibiDataLayer": {
 "map-location": {
 "map_by_field": "FATALCMP2.SEG01.COUNTY_NAME",
 "parameters": [
 {
 "parm_field": "FATALCMP2.SEG01.COUNTY_NAME",
 "parm_georole": "USCOUNTY"
 },
 {
 "parm_field": "FATALCMP2.SEG01.State_Name",
 "parm_georole": "USSTATE"
 }
 ],
 "returned_georole": "USCOUNTY"
 }
 }
 }
 ],
 "baseMapInfo": {
 "customBaseMaps": [
 {
 "ibiBaseLayer": "gray"
 }
 ]
 }
 }
},
"pieProperties": {
 "holeSize": "0%"
},
"agnosticSettings": {
 "chartTypeFullName": "Choropleth"
}
*END

*GRAPH_JS_FINAL
series: [ {"series": 'reset', "tooltip": '{{tooltip1}}<br>{{tooltip2}}<br>{{tooltip3}}<br>{{tooltip4}}'} ],
htmlToolTip: {enable: true, snap: false }
*END
ENDSTYLE
END
-RUN


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2225 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Gold member
posted Hide Post
thank you.

i tried your code and still shows only the counts(as in original screenshot) and not the county names in the data label.

also it doesn't show proper values in the tooltip which it used to show originally. FYI - the issue is about displaying more fields in the data label and not about tooltip which works fine using my code too.

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


WebFOCUS 8
Windows, All Outputs
 
Posts: 62 | Registered: January 23, 2018Reply With QuoteReport This Post
Expert
posted Hide Post
Another case of RTFM!

Search the JSCHART.PDF manual for dataLabels and you will locate the syntax for "Using a callback function to format data labels" where you can add values from your data.

I would urge you to try the sample first to see how it works because I am not confident that chloropleth charts act the same.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5617 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
If you interogate the output of a chloropleth chart, you will see that the data labels are SVG text elements and to get multiple lines you have to use <tspan> elements.

The issue comes when you use document.createElement("tspan"), append attributes and then try and pass that back to the function call.

The JS library used for chloropleth charts does not like this and is just expecting plain text not an object.

You can get the data values returned to the data labels but you cannot format them in a reasonable manner.

You might have to raise this with tech support who would be able to advise if it is possible (unknownst to me) or whether an NFR should be raised.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5617 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Gold member
posted Hide Post
thank you tony. i raised this defect with techsupport and they have forwarded to product as a NFR.

so i guess i have to wait on this.


WebFOCUS 8
Windows, All Outputs
 
Posts: 62 | Registered: January 23, 2018Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [NFR] show more info in the map chart data label

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