(Solved)Mouse over function on the entire js chart
Is there a way for a jschart chart to have mouse over to drill down to another report. Presently I use gauge and I have drill down on click of needle, But i need a way to hover over any part of jschart and should drill down to another report.
Thank you.
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 car
-* Created by Info Assist for Graph
SUM CAR.BODY.SALES
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO 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 0
ON GRAPH SET GRXAXIS 0
ON GRAPH SET LOOKGRAPH GAUGE1
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/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*GRAPH_JS_FINAL
gaugeProperties: {
startAngle: 135,
endAngle: 45,
secondaryNeedlesAsMarkers: false,
groupLabel: {
visible: false,
font: '10pt Sans-Serif',
color: 'black'
},
totalLabel: {
visible: false,
font: '10pt Sans-Serif',
color: 'black',
numberFormat: 'auto',
},
fill: {
color: 'transparent'
},
needleBase: {
size: 10,
color: 'red',
border: {
width: 3,
color: 'green',
dash: '1 1'
}
},
axisWidth: '22%',
axisTickLength: '30%',
outerBorder: {
width: '5%',
fill: {
color: '#1f77b4'
},
border: {
width: 0,
color: 'transparent',
dash: ''
}
}
},
title: {
text: 'Test',
visible: true,
align: 'center',
font: 'Bold 12pt Trebuchet MS',
color: 'black',
tooltip: 'Test',
},
groupLabel: {
tooltip: 'Test',
},
*END
ENDSTYLE
END
-RUN
-*IA_GRAPH_FINISH
This message has been edited. Last edited by: rkiran1,
Version 8.2.03 Output : HTML, Excel & PDF
January 21, 2020, 04:59 PM
Waz
You should be able to use standard drill functionality.
Check the documentation.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
January 22, 2020, 01:49 PM
rkiran1
Hi Waz,
I couldn't find any drill down function on the entire chart. Is there a sample you could share.
Hi Waz, Thank you for the quick response. I have not framed the question properly initially. I am able to drill down on the needle as you suggested but I need to drill down not only on the needle. I need a drill down anywhere on the chart, as the end users are not aware of the drill down present on the needle.
Thanks
Version 8.2.03 Output : HTML, Excel & PDF
January 23, 2020, 02:12 PM
Waz
I'm not sure if you can do this with standard drill functionality. Depend on what TYPEs the chart supports in the stylesheet.
But here is something that I came up with awhile back.
The charting engine support events. The difficult part is adding them in as WebFOCUS does not (as far as I am aware) support them.
-HTMLFORM BEGIN
<script>
function myClickEvent(chtObj) {
alert('time to do something, click on ' + chtObj.chartObjName);
}
</script>
-HTMLFORM END
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 car
-* Created by Info Assist for Graph
SUM CAR.BODY.SALES
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO 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 0
ON GRAPH SET GRXAXIS 0
ON GRAPH SET LOOKGRAPH GAUGE1
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/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*GRAPH_JS_FINAL
gaugeProperties: {
startAngle: 135,
endAngle: 45,
secondaryNeedlesAsMarkers: false,
groupLabel: {
visible: false,
font: '10pt Sans-Serif',
color: 'black'
},
totalLabel: {
visible: false,
font: '10pt Sans-Serif',
color: 'black',
numberFormat: 'auto',
},
fill: {
color: 'transparent'
},
needleBase: {
size: 10,
color: 'red',
border: {
width: 3,
color: 'green',
dash: '1 1'
}
},
axisWidth: '22%',
axisTickLength: '30%',
outerBorder: {
width: '5%',
fill: {
color: '#1f77b4'
},
border: {
width: 0,
color: 'transparent',
dash: ''
}
}
},
title: {
text: 'Test',
visible: true,
align: 'center',
font: 'Bold 12pt Trebuchet MS',
color: 'black',
tooltip: 'Test',
},
groupLabel: {
tooltip: 'Test',
},
*END
*GRAPH_JS
});
chart.registerEvent(myClickEvent, 'click', 'chart');
chart.set({
*END
ENDSTYLE
END
-RUN
Thank you again for the example and for sharing the post.
Version 8.2.03 Output : HTML, Excel & PDF
January 23, 2020, 04:30 PM
Waz
Please update the title of the thread by editing your first post and adding [SOLVED] to the title
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
January 28, 2020, 01:10 PM
rkiran1
quote:
-HTMLFORM BEGIN <script> function myClickEvent(chtObj) { alert('time to do something, click on ' + chtObj.chartObjName); }
-HTMLFORM END
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 car -* Created by Info Assist for Graph SUM CAR.BODY.SALES ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET VZERO 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 0 ON GRAPH SET GRXAXIS 0 ON GRAPH SET LOOKGRAPH GAUGE1 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/ENIADefault_combine.sty,$ TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $ *GRAPH_SCRIPT setReportParsingErrors(false); setSelectionEnableMove(false); *GRAPH_JS_FINAL gaugeProperties: { startAngle: 135, endAngle: 45, secondaryNeedlesAsMarkers: false, groupLabel: { visible: false, font: '10pt Sans-Serif', color: 'black' }, totalLabel: { visible: false, font: '10pt Sans-Serif', color: 'black', numberFormat: 'auto', }, fill: { color: 'transparent' },