srividya_sharma

Members
  • Content count

    943
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by srividya_sharma

  1. FusionCharts Spring MVC Example

    Hello All, For the benefit of all Spring MVC users, I have come up with a simple example. Please find the complete web application attached. Please put in the neccessary Spring jars in the WEB-INF/lib folder, before testing. Please feel free to give your valuable comments and suggestions. Srividya SpringExampleApril2010.zip
  2. Hi everybody, The fusionchartsexporter.jar provided with the v3.1 download is for java6. Many users are using java5 or the all-time favourite jdk1.4.2. I thought it might be useful to post the fusioncharts exporter jar for these versions here. Srividya
  3. Hi everybody, I will post all the FusionCharts JSF tag libraries and samples here. Please use the version that suits your environment. Regards.
  4. This is a short tutorial on "How to use FusionCharts JSF Tag Library in xhtml with Facelets" I assume the jars/configuration required for facelets are already in place. I will just give a small write-up on that here. Facelet Setup: Jars in WEB-INF/lib jsf-facelets.jar jsf-api.jar jsf-impl.jar jstl-1.2.jar You might also need el jars. Configure the ViewHandler in faces-config.xml <faces-config> <application> <!-- tell JSF to use Facelets --> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> </application> </faces-config> Configure xhtml in web.xml <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.xhtml</param-value> </context-param> Configure FacesServlet in web.xml <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> Now, facelets is configured. Let us see how to use the FusionCharts Tag Library with facelets and xhtml. The JSF tag library can be obtained in this topic http://www.fusioncharts.com/forum/Topic14110-33-1.aspx . Steps to use the tag library with facelets: Place the fusionchartstaglibJSF1-2-java5.jar in WEB-INF/lib ( classpath ) Place fusioncharts.taglib.xml in WEB-INF/lib folder Modify web.xml and add the context-param as shown: <context-param> <param-name>facelets.LIBRARIES</param-name> <param-value> /WEB-INF/lib/fusioncharts.taglib.xml </param-value> </context-param> That finishes the setup for using FusionCharts JSF tag library with facelets and xhtml. Now, lets embed the chart in xhtml. Following the conventions, lets use a template for our xhtml. Here is a sample template.xhtml : <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en"> <f:view> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Test XHTML</title> <script type="text/javascript" src="../FusionCharts/FusionCharts.js"></script> </head> <body> This is from template <ui:insert name="content"/> </body> </f:view> </html> Now lets create a SimpleUIChart.xhtml as shown: <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" xmlns:fc="http://www.fusioncharts.com" template="./template.xhtml"> <ui:define name="content"> <f:verbatim>This is JSF example</f:verbatim> <br/> <fc:render chartId="SimpleChart" filename="FusionCharts/Column3D.swf" width="700" height="300" url="Data/Data.xml"/> </ui:define> </ui:composition> Thats it! We can now view the Column chart with data from Data.xml. Just ensure that the path to the FusionCharts.js file, .swf file and .xml file are correct. Hope this short tutorial helps everybody. I hope I did not miss any setting/configuration. Please feel free to write your comments and suggestions on this topic. Thanks Srividya
  5. FusionCharts Struts2 Example

    Hi All, I have developed a small application to show the usage of FusionCharts in Struts2. This example will show how to embed charts in the page, how to provide data to the chart from the action etc. The example consists of 2 charts. ( Database and Drill down example ) The attached zip file contains all the files except the FusionCharts folder and the Struts2 jars. Please follow the instructions in the readme file for setup. Hope this is useful. Please contact me in case you have any issues with this. regards, Srividya FC-Struts2.zip
  6. Hi In order to use a jsp file you would need to deploy it as part of an application in a web server like tomcat. If you already have IIS installed, you should probably try deploying the asp file. Hope this helps. Srividya
  7. Hi, Can you please confirm that you are running this after deploying to a web server and StockPrice.jsp is accessible from the web address? Srividya
  8. Dynamic Chart Create In Servlet

    Are you using the latest version of FusionCharts or a previous version?
  9. Fusioncharts With Jsf 2.0

    Can you please attach the file, I could not find it. thanks Srividya Sharma
  10. Server Side Chart Export - Suppress Log

    I can't think of any problems with this. Can you please verify that you have configured log4j correctly? Hope this helps. Srividya Sharma
  11. Can I Define The Name Of The Data Of Powerchart ?

    Hi, To get the chart data as xml in javascript, yo uwould use the following code: var chartReference = FusionCharts("myChartId"); var chartXML = chartReference.getXMLData(); After getting this data, you can set it in some hidden field in the page. You can use the same field name on the server, to retrieve its value. Hope this is what you were looking for. Hope this helps. Srividya Sharma
  12. Hi, Can you please check out the samples provided in the download package? They have examples of creating the xml in java. Srividya
  13. Hi everybody, This Christmas, we have upgraded the FusionCharts sample RoR application to Rails 3. I assume the database creation etc to be same as the application provided with FusionCharts download package. Hope you find it useful. Await your valuable suggestions/feedback. I have tried to fix everything, in case, you run into any issues please inform me. Merry Christmas, Srividya Ask and you shall get - FusionCharts SampleAppRails3.zip
  14. FusionCharts Exporter Jars For Different Java Versions

    We do not have the exporter jar for jdk < 1.4. Sorry about that.
  15. Fusioncharts With Jsf 2.0

    hi, Currently the tag library has not been updated for JSF 2. Sorry about that. Srividya Sharma
  16. FusionCharts JSF-All Tag Libraries & Samples

    Hi Thank you for using the JSF tag library. I will take a look at your problem, but it might take some time to do the changes. Thank you for your patience. Srividya Sharma
  17. Server Side Exporting Fusion Charts To Pdf

    Hi Neeraja, For server side export, you do not need a button click. It can be automatically exported after the chart renders. Please incorporate automatic export after you achieve manual export. I will take a look at the files you have attached and get back to you soon. Srividya Sharma
  18. Hi everybody, Here is a FusionCharts sample RoR application which works with rails 2.3.5. Please place the .swf files in public/FusionCharts folder, before testing. I assume the database creation etc to be same as the application provided with FusionCharts download package. Hope you find it useful. Please give me your valuable suggestion/feedback. In case, it does not work, please tell me. :w00t: Srividya Rails2-3-5SampleApp.zip
  19. Fusion charts with rich faces.

    Glad to help. Happy FusionCharting!
  20. Server Side Exporting Fusion Charts To Pdf

    Hi Neeraja, Thank you for posting the xml and html. I took a look at the version of the swf and it seems to be latest. Also, I am getting a capturing window when I initiate export. Can you please try the Export example present in Download Package > Code > J2EE > ExportExample once? See if that works. Most likely, it is an issue with either 1. the path to the export handler (exportHandler attribute) or 2. version of flash player - please check this Hope this helps Srividya Sharma
  21. Fusion charts with rich faces.

    Hi, I think you have missed placing fcsampleshelper.jar in the WEB-INF/lib folder. Please do so. Can you please send a screen-shot of the error/page you are seeing? regards, Srividya Sharma
  22. Percent Width/height Charts Not Working

    Hi Please ensure that the chart container has a width and height specified. Fr example, in your code, you would have the div defined as follows: <div id="superTestChart" style="height:400px;width:400px;">FusionCharts will load here</div> If the chart itself is not loading, then it must have something to do with the data. Please post the screen-shot of the error and debug window. Hope this helps. Srividya Sharma
  23. Evaluation Tutorial: Msdbexample.jsp - Error Loading Data

    Hi I took a look at the code in the bean again. I think I figured it out. There were a few duplicate statements in the MSFactoriesData bean. Hence, the connection might have been busy and the xml was not generated correctly. Please replace the attached fcsampleshelper.jar in your application and try it out. ( remove cache from tomcat if needed ) rename .zip to .jar. Hope this helps! Srividya Sharma fcsampleshelper.zip
  24. Evaluation Tutorial: Msdbexample.jsp - Error Loading Data

    Hi Please contact [email protected] or submit a ticket at http://support.fusioncharts.com/ for professional help. One last shot, can you tell me the version of JSTL and tomcat you are using? Srividya Sharma
  25. Evaluation Tutorial: Msdbexample.jsp - Error Loading Data

    Hi The zip file you attached works like a charm here! ok, here is another idea. Please modify the MSDBExample.jsp present within JSP/DBExample folder as follows: 1. remove the existing fc:render tag and put the following in its place: <fc:render chartId="${factoriesBean.chartId}" swfFilename="${folderPath}${factoriesBean.filename}" width="${factoriesBean.width}" height="${factoriesBean.height}" debugMode="true" registerWithJS="false" dataFormat="xml"> <?xml version="1.0" encoding="UTF-8" standalone="no"?><chart animation="1" caption="Factory Output report" formatNumberScale="0" rotateValues="1" showValues="0" subCaption="By Quantity" xAxisName="Factory" yAxisName="Units"><categories><category label="1-02-2003" /><category label="1-03-2003" /><category label="1-04-2003" /><category label="1-05-2003" /><category label="1-06-2003" /><category label="1-07-2003" /><category label="1-08-2003" /><category label="1-09-2003" /><category label="1-10-2003" /><category label="1-11-2003" /><category label="1-12-2003" /><category label="1-13-2003" /><category label="1-14-2003" /><category label="1-15-2003" /><category label="1-16-2003" /><category label="1-17-2003" /><category label="1-18-2003" /><category label="1-19-2003" /><category label="1-20-2003" /></categories><dataset seriesName="Factory 1"><set value="23" /><set value="22" /><set value="24" /><set value="32" /><set value="21" /><set value="34" /><set value="32" /><set value="32" /><set value="23" /><set value="23" /><set value="32" /><set value="53" /><set value="23" /><set value="26" /><set value="43" /><set value="16" /><set value="45" /><set value="65" /><set value="54" /></dataset><dataset seriesName="Factory 2"><set value="121" /><set value="123" /><set value="122" /><set value="124" /><set value="132" /><set value="121" /><set value="134" /><set value="132" /><set value="132" /><set value="123" /><set value="123" /><set value="132" /><set value="153" /><set value="123" /><set value="126" /><set value="143" /><set value="116" /><set value="145" /><set value="165" /><set value="154" /></dataset><dataset seriesName="Factory 3"><set value="54" /><set value="56" /><set value="89" /><set value="56" /><set value="98" /><set value="76" /><set value="65" /><set value="45" /><set value="75" /><set value="54" /><set value="75" /><set value="76" /><set value="34" /><set value="97" /><set value="55" /><set value="43" /><set value="16" /><set value="35" /><set value="78" /><set value="75" /></dataset></chart> </fc:render> What this does is, it puts the xml generated from my database as hardcoded xml for the chart. If this works on your end, then the problem is either with the retrieval of data and/or generation of xml. Lets take it from there. Srividya Sharma