2010-08-20 4 views
0

webcharts3d를 사용하여 웹 페이지의 게이지 그래프를 만듭니다. 차트에 onclick 이벤트를 추가하고 싶습니다. 어떻게 할 것인가?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> 
+0

하이퍼 링크를 좋아하세요? 일부 차트 모델에는 게이지 차트가 표시되지 않지만 "액션"특성이 있습니다. 그렇지 않다면 앵커 태그에 차트를 래핑하는 것은 어떻습니까? – Leigh

답변

0

결국 차트 유형을 swf 대신 png로 설정했습니다. 그런 다음 앵커 태그로 둘러 쌀 수있었습니다.

oMyChart2.type = "png"; 

대신

oMyChart2.type = "swf"; 
+0

내 생각에 다행 이네;) – Leigh

0

있습니다 URL 인 cfchart에서 이벤트 :

여기 내 코드입니다. 그것을 확인할 수 있습니다.

+0

예,하지만 cfchart는 afaik에 직접 게이지 차트를 지원하지 않습니다. 이것이 cfchart 태그가 아닌 위의 코드를 사용하는 이유입니다. – Leigh

0

이것은 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)> 
+1

미안하지만, OP가 Gauge not Pie를 사용하고 있다는 것을 간과했다. – Metcalf