我正在使用webcharts3d为我的网页创建一个仪表图。我想在图表中添加一个onclick事件--你知道怎么做吗?
下面是我的代码:
<cfsavecontent variable="chartStyle">
<!--- xml chart style --->
</cfsavecontent>
<cfsavecontent variable="chartModel"><?xml version="1.0" encoding="UTF-8"?>
<XML type="default">
<COL>2000</COL>
<cfoutput><ROW col0="#url.rating#">Sample 0:</ROW></cfoutput>
</XML></cfsavecontent>
<cfscript>
oMyWebChart = createObject("Java","com.gp.api.jsp.MxServerComponent");
oMyApp = getPageContext().getServletContext();
oSvr = oMyWebChart.getDefaultInstance(oMyApp);
oMyChart2 = oSvr.newImageSpec();
oMyChart2.width = 120;
oMyChart2.height= 120;
oMyChart2.type = "swf";
oMyChart2.style = "#chartStyle#";
oMyChart2.model = "#chartModel#";
</cfscript>
<cfsavecontent variable="chartImgTag">
<cfoutput>#oSvr.getImageTag(oMyChart2,"http://myWebsite.com/CFIDE/GraphData.cfm?graphCache=wc50&graphID=")#</cfoutput>
</cfsavecontent>
<cfoutput>
#chartimgtag#
</cfoutput>发布于 2010-08-24 00:48:58
我最终做的是将图表类型设置为png而不是swf。然后我就可以用一个锚标签把它包围起来。
oMyChart2.type = "png"; 而不是
oMyChart2.type = "swf"; 发布于 2010-08-21 22:13:12
cfchart中存在URL事件。你可以去看看。
发布于 2012-02-29 04:47:56
这就是我的工作,保持oMyChart2.type = "swf";
<!--- Extract the style from the WCP file --->
<cfset wcp = XMLParse( ExpandPath("reports/pie.wcp") )>
<cfset wcp.project.style.pieChart.elements.XmlAttributes.action = "javascript:alert('$(colLabel)')">
<cfset chartStyle = ToString(wcp.project.style.pieChart)>https://stackoverflow.com/questions/3532166
复制相似问题