Ranen
Members-
Content count
35 -
Joined
-
Last visited
Everything posted by Ranen
-
2 Charts In Single Row, One After Another-Side By Side
Ranen replied to Ranen's topic in FusionCharts and JSP
Hello, Thanks for the reply, see mine is a portlet, I have one portlet which needs to display 4 charts - in 2 rows(say<tr><td>1 chart</td><td> 2 chart</td></tr> - this is the first row), now when user clicks the 1st chart, it has to display another charts just under the first row, basically its drill down charts, now my problem is to display 2 charts in one row, I am not using any styles yet, my env is Liferay portal server, I am attaching one war, but the 2nd one(.war) I can't, its a web service call. Let me know if you have a solution for this problem. Regards, Ranen <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib uri="http://www.fusioncharts.com/jsp/core" prefix="fc" %> <%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> <portlet:defineObjects/> <c:set var="folderPath" value="/ChartHandler-portlet/FusionCharts/"/> <c:set var="title" value="FusionCharts - Array Example using Single Series Column 3D Chart" scope="request"/> <c:set var="header1" value="FusionCharts - Examples" scope="request"/> <c:set var="header2" value="Displaying Transaction Data for Column Chart" scope="request"/> <c:set var="jsPath" value="${folderPath}" scope="request"/> <c:set var="assetCSSPath" value="/ChartHandler-portlet/JSP/assets/ui/css/" scope="request"/> <c:set var="assetJSPath" value="/ChartHandler-portlet/JSP/assets/ui/js/" scope="request"/> <c:set var="assetImagePath" value="/ChartHandler-portlet/JSP/assets/ui/images/" scope="request"/> <%@page import="com.bfds.web.bean.PurRedNetBean"%> <% System.out.println("this is the new JSP for TransactionBarChartBean >>> "); PurRedNetBean purRedNetBean = (PurRedNetBean)renderRequest.getAttribute("purRedNetBean"); System.out.println("JSP>>>>this is the new JSP for purRedNetBean >purRedNetBean>> "+ purRedNetBean); %> <div> <div class="left"> <tags:template2> <fc:render chartId="${purRedNetBean.chartIdPie}" swfFilename="/ChartHandler-portlet/FusionCharts/Pie2D.swf" width="450" height="300" debugMode="false" registerWithJS="false" xmlData="${purRedNetBean.pieXml}" /> </tags:template2> </div> <div class="right"> <tags:template2> <fc:render chartId="${purRedNetBean.chartIdColumn}" swfFilename="/ChartHandler-portlet/FusionCharts/Column2D.swf" width="450" height="300" debugMode="false" registerWithJS="false" xmlData="${purRedNetBean.columnPurRedNetXml}" /> </tags:template2> </div> </div> package com.bfds.web.bean; import java.util.List; import com.fusioncharts.sampledata.ChartType; public class PurRedNetBean { private String heightPie = "300"; private String widthPie = "450"; private String heightColumn = "300"; private String widthColumn = "450"; private String pieXml; private String columnPurRedNetXml; private String purCntXml; private String purSumXml; private String redCntXml; private String redSumXml; private String netSumXml; private String netCntXml; private String chartIdPie = "transactionPie"; private String chartIdColumn = "transactionColumn"; private String url = null; private String filename = ChartType.COLUMN3D.getFileName(); public PurRedNetBean(){ } public String getHeightPie() { return heightPie; } public void setHeightPie(String heightPie) { this.heightPie = heightPie; } public String getWidthPie() { return widthPie; } public void setWidthPie(String widthPie) { this.widthPie = widthPie; } public String getPieXml() { return pieXml; } public void setPieXml(String pieXml) { this.pieXml = pieXml; } public String getColumnPurRedNetXml() { return columnPurRedNetXml; } public void setColumnPurRedNetXml(String columnPurRedNetXml) { this.columnPurRedNetXml = columnPurRedNetXml; } public String getPurCntXml() { return purCntXml; } public void setPurCntXml(String purCntXml) { this.purCntXml = purCntXml; } public String getPurSumXml() { return purSumXml; } public void setPurSumXml(String purSumXml) { this.purSumXml = purSumXml; } public String getRedCntXml() { return redCntXml; } public void setRedCntXml(String redCntXml) { this.redCntXml = redCntXml; } public String getRedSumXml() { return redSumXml; } public void setRedSumXml(String redSumXml) { this.redSumXml = redSumXml; } public String getNetSumXml() { return netSumXml; } public void setNetSumXml(String netSumXml) { this.netSumXml = netSumXml; } public String getNetCntXml() { return netCntXml; } public void setNetCntXml(String netCntXml) { this.netCntXml = netCntXml; } public String getChartIdPie() { return chartIdPie; } public void setChartIdPie(String chartIdPie) { this.chartIdPie = chartIdPie; } public String getChartIdColumn() { return chartIdColumn; } public void setChartIdColumn(String chartIdColumn) { this.chartIdColumn = chartIdColumn; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getFilename() { return filename; } public void setFilename(String filename) { this.filename = filename; } public String getHeightColumn() { return heightColumn; } public void setHeightColumn(String heightColumn) { this.heightColumn = heightColumn; } public String getWidthColumn() { return widthColumn; } public void setWidthColumn(String widthColumn) { this.widthColumn = widthColumn; } public void constructPieColumnXml(PurRedNetForZoomlineChartRecords purRedNetForZoomlineChartRecords){ System.out.println("<<<<<<<<<<< contsructing Pie Column chart >>>>>>>"); List<PurRedNetForZoomlineChartRecord> purRedNetForZoomlineChartRecordList = null; Integer purCnt = 0; Integer redCnt = 0; Integer netCnt = 0; purRedNetForZoomlineChartRecordList = purRedNetForZoomlineChartRecords.getPurRedNetForZoomlineChartRecord(); for(PurRedNetForZoomlineChartRecord prn:purRedNetForZoomlineChartRecordList){ purCnt +=prn.getPurCnt(); redCnt +=prn.getRedCnt(); netCnt +=prn.getNetCnt(); } pieXml ="<chart caption='2012 Transaction Data in Pie Chart' showPercentValues='1'>"; pieXml +="<set label='PurCnt' value='"+purCnt+"'/>"; //link="newchart-xmlurl-Data2004.xml" pieXml +="<set label='RedCnt' value='"+redCnt+"'/>"; pieXml +="<set label='NetCnt' value='"+netCnt+"'/>"; pieXml +="</chart>"; columnPurRedNetXml="<chart caption='2012 Transaction Data in Column Chart' xAxisName='PurRedNet' yAxisName='Number' numberPrefix='' showValues='0'>"; columnPurRedNetXml +="<set label='PurCnt' value='"+purCnt+"'/>"; columnPurRedNetXml +="<set label='RedCnt' value='"+redCnt+"'/>"; columnPurRedNetXml +="<set label='NetCnt' value='"+netCnt+"'/>"; columnPurRedNetXml +="</chart>"; } public void constructColumnPurRedNetXml(PurRedNetForZoomlineChartRecords purRedNetForZoomlineChartRecords){ } public void constructPurCntXml(PurRedNetForZoomlineChartRecords purRedNetForZoomlineChartRecords){ } public void constructpurSumXml(PurRedNetForZoomlineChartRecords purRedNetForZoomlineChartRecords){ } public void constructRedCntXml(PurRedNetForZoomlineChartRecords purRedNetForZoomlineChartRecords){ } public void constructRedSumXml(PurRedNetForZoomlineChartRecords purRedNetForZoomlineChartRecords){ } public void constructNetSumXml(PurRedNetForZoomlineChartRecords purRedNetForZoomlineChartRecords){ } public void constructNetCntXml(PurRedNetForZoomlineChartRecords purRedNetForZoomlineChartRecords){ } } -
2 Charts In Single Row, One After Another-Side By Side
Ranen replied to Ranen's topic in FusionCharts and JSP
Here is the image -
Hello, Can I get any example/tutorials of how to use fusioncharts in portlet env in liferay? Let me know if you have any link. Regards, R
-
http://www.liferay.com/community/forums/-/message_boards/message/21479048
-
I am able to bring up the chart inside liferay using fusioncharts, I used Generic portlet- if this example help others- that would be great
-
Can anyone help me getting a simple fusioncharts example for liferay portal?????
-
Hello, I am new to Fusion charts. I am able to deploy and successfully run the example .war file(= FusionCharts_J2EE.war). After that, what I did - is create a new dynamic web project, followed the instructions properly and just trying to run the - http://localhost:8181/FusionChartsTestExample/SimpleChart.jsp( which is JSP Basic Examples) But I am unable to see the chart - I got "Chart" instead of the chart, I printed the return object and I got full xml data, basically somewhere the below part is not working, mind you, I followed all the steps like putting proper .jar files, templates etc. I guess the problem is here- <fc:render chartId="${chartData.chartId}" swfFilename="${folderPath}${chartData.swfFilename}" width="${chartData.width}" height="${chartData.height}" debugMode="false" registerWithJS="false" xmlUrl="${chartData.url}" /> </c:catch> It did not print Tag Error, that means it still in <fc:render> Any idea where am I doing wrong. Thanks, Ranen
-
To add my above reply, here is my directory structures:- My jsps are inside WEB-INF/ folder, in case of examples frfom fusioncharts, its just outside Web-Inf, but I want inside Web inf
-
Thanks Deepti, I found the error, but do not know how to fix - here is whats my findings:- One which works(comes from Fusioncharts .war) firbug's content area out put:- <div class="content-area"> <div id="content-area-inner-main"> <h2 class="headline">Plotting single series chart from data contained in Array.</h2> <div class="gen-chart-render"> <div id="productSalesDiv" align="center"> <object type="application/x-shockwave-flash" lang="EN" class="FusionCharts" data="../../FusionCharts/Column3D.swf" width="600" height="300" id="productSales" style="visibility: visible;"> <param name="scaleMode" value="noScale"/> <param name="scale" value="noScale"/> <param name="wMode" value="opaque"/> <param name="allowScriptAccess" value="always"/> <param name="quality" value="best"/> <param name="flashvars" value="lang=EN&debugMode=0&dataXML=%3Cchart%20caption%3D'Sales%20by%20Product'%20numberPrefix%3D'%24'%20formatNumberScale%3D'0'%3E%3Cset%20label%3D'Product%20A'%20value%3D'567500'%20%2F%3E%3Cset%20label%3D'Product%20B'%20value%3D'815300'%20%2F%3E%3Cset%20label%3D'Product%20C'%20value%3D'556800'%20%2F%3E%3Cset%20label%3D'Product%20D'%20value%3D'734500'%20%2F%3E%3Cset%20label%3D'Product%20E'%20value%3D'676800'%20%2F%3E%3Cset%20label%3D'Product%20F'%20value%3D'648500'%20%2F%3E%3C%2Fchart%3E&DOMId=productSales®isterWithJS=1&chartWidth=600&chartHeight=300&InvalidXMLText=Invalid data.&dataURL="/> </object> </div> <script type="text/javascript"> 1 var chart_productSales = new FusionCharts({"renderAt":"productSalesDiv","id":"productSales","debugMode":"0","dataSource":"<chart caption='Sales by Product' numberPrefix='$' formatNumberScale='0'><set label='Product A' value='567500' /><set label='Product B' value='815300' /><set label='Product C' value='556800' /><set label='Product D' value='734500' /><set label='Product E' value='676800' /><set label='Product F' value='648500' /></chart>","dataFormat":"xml","swfUrl":"../../FusionCharts/Column3D.swf","registerWithJS":"0","height":"300","width":"600"}).render(); </script> </div> <div class="clear"/> <p/> <p class="small"> </p> <div class="underline-dull"/> </div> </div> One which does not work:- firebug content area: <div class="content-area"> <div id="content-area-inner-main"> <h2 class="headline">Plotting single series chart from data contained in Array.</h2> <div class="gen-chart-render"> <div id="productSalesDiv" align="center">Chart.</div> <script type="text/javascript"> 1 var chart_productSales = new FusionCharts({"dataFormat":"xml","dataSource":"<chart caption='Sales by Product' numberPrefix='$' formatNumberScale='0'><set label='Product A' value='567500' /><set label='Product B' value='815300' /><set label='Product C' value='556800' /><set label='Product D' value='734500' /><set label='Product E' value='676800' /><set label='Product F' value='648500' /></chart>","height":"300","width":"600","swfUrl":"C:/apache-tomcat-6.0.36/webapps/FusionChartsTestExample/FusionCharts/Column3D.swf","registerWithJS":"0","renderAt":"productSalesDiv","debugMode":"0","id":"productSales"}).render(); </script> </div> <div class="clear"/> <p/> <p class="small"> </p> <div class="underline-dull"/> </div> </div> After looking the above debugging code - i think somewhere my .js and .swf files are not loaded , I tried 2 ways to load <c:set var="folderPath" value="../../FusionCharts/"/> <c:set var="folderPath" value="C:/apache-tomcat-6.0.36/webapps/FusionChartsTestExample/FusionCharts/"/> And also I saw in firebug, the js file and css are not accessible - Access to restricted URI denied. Why do I get this kind of error, thanks
-
New To Fusion Chart: Xml Return Type From Spring Restful Ws
Ranen posted a topic in FusionCharts and JSP
Hello, I am new to fusioncharts, I want to display a chart base on the return type from Webservice, web service will return xml data. I want to see in a chart. Since I am totally new to fusion chart, is there any start up examples etc, if yes, plz point me to proper location thanks