Fórumok

Chart portlet

thumbnail
Rotsen Zerolf, módosítva 16 év-val korábban

Chart portlet

Junior Member Bejegyzések: 28 Csatlakozás dátuma: 2008.01.16. Legújabb bejegyzések
Is there a sample portlet displaying pie charts where all we have to do is pluging our data.

I have been trying to create a portlet using Jfreechart but my knowledge of Java and portlets
creation is very bad.

Thanks,

rotseN
Ricardo Uhalde, módosítva 16 év-val korábban

RE: Chart portlet

New Member Bejegyzések: 9 Csatlakozás dátuma: 2007.09.20. Legújabb bejegyzések
Take a look at BIRT project at http://www.eclipse.org/birt/phoenix/

Its a report solution that you can easily integrate inside a portlet with an IFrame by means of their Web Viewer. BIRT also has one of the best report designers of all, better than jasperreport Ireport.

You can use it to generate many types of charts, pie, bars, gantt, etc. Give it a try, you'll loved as I did.
thumbnail
Rotsen Zerolf, módosítva 16 év-val korábban

RE: Chart portlet

Junior Member Bejegyzések: 28 Csatlakozás dátuma: 2008.01.16. Legújabb bejegyzések
I am downloading BIRT with everything. My problem is that I do not know how to create a portlet.
There a examples of portlets with JSP file but I do not know how to create a portlet with a Java file and then when I
compile the java file I need to name it as the class is named inside the file, so how do I convert this java file to be
index.jsp which is the default file for portlet. I am also reading about all the different XML files
thumbnail
Rotsen Zerolf, módosítva 16 év-val korábban

RE: Chart portlet

Junior Member Bejegyzések: 28 Csatlakozás dátuma: 2008.01.16. Legújabb bejegyzések
I created a chart project "myfirstchart" using BIRT. I then use the directory "myfirstchart" were all the files were created
and made it into a zip file. I then uploaded the zip file and I got some errors. Again, I have problems understanding the
XML files in WEB-INF. My errors:

00:03:38,081 INFO [PluginPackageHotDeployListener:74] Reading plugin package for myfirstchart
00:03:38,081 WARN [PluginPackageHotDeployListener:123] Plugin package on context myfirstchart cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file
00:03:38,362 INFO [PluginPackageHotDeployListener:187] Plugin package myfirstchart/myfirstchart/unknown/war registered successfully
00:03:38,378 INFO [PortletHotDeployListener:133] Registering portlets for myfirstchart
00:03:38,425 ERROR [HotDeployUtil:60] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for myfirstchart
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for myfirstchart
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:431)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:85)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:42)
at com.liferay.portal.kernel.servlet.PortletContextListener.portalInit(PortletContextListener.java:45)
at com.liferay.portal.kernel.util.PortalInitableUtil.init(PortalInitableUtil.java:39)
at com.liferay.portal.kernel.servlet.PortletContextListener.contextInitialized(PortletContextListener.java:52)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1105)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1306)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: com.liferay.portlet.WAIFriendlyURLMapper
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1362)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1208)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:196)
... 16 more


Maybe this means something to some of you experts and can tell me what it is?

thanks,

rotseN
Ricardo Uhalde, módosítva 16 év-val korábban

RE: Chart portlet

New Member Bejegyzések: 9 Csatlakozás dátuma: 2007.09.20. Legújabb bejegyzések
The fastest and easiest way to code a portlet if you are a newbie, is to use Sun Java Studio Creator. Its all in there, a JSR168 portlet project, a Pluto portal container to debug your portlet, etc.

The only things you need to add to deploy that portlet inside Liferay are liferay-portlet.xml and liferay-display.xml, you can have info of those here in Liferay website.

To download SJSC you need to sign an account in Sun website here http://developers.sun.com/jscreator/downloads/, its free for members.
thumbnail
Rotsen Zerolf, módosítva 16 év-val korábban

RE: Chart portlet

Junior Member Bejegyzések: 28 Csatlakozás dátuma: 2008.01.16. Legújabb bejegyzések
I will try that.

Gracias,

rotseN
thumbnail
Rotsen Zerolf, módosítva 16 év-val korábban

RE: Chart portlet

Junior Member Bejegyzések: 28 Csatlakozás dátuma: 2008.01.16. Legújabb bejegyzések
I tried using Sun studio to create portlet and I did the tutorial where you can go from PortltPage1 to PortletPage2
but it did not work going to PortletPage2 but I was able to see PortletPage1. I did the same tutorial about
4 times and every time it did not go to the next PortletPage2. I can feel th ebig L of Looser in my forhead.

I will keep trying :-(
thumbnail
Victor Zorin, módosítva 16 év-val korábban

RE: Chart portlet

Liferay Legend Bejegyzések: 1228 Csatlakozás dátuma: 2008.04.14. Legújabb bejegyzések
Rotsen Zerolf:
Is there a sample portlet displaying pie charts where all we have to do is pluging our data.

I have been trying to create a portlet using Jfreechart but my knowledge of Java and portlets
creation is very bad.

Thanks,

rotseN


Simple to use Liferay portlet package is described at MyOffice24x7 BI Chart Portlets. It also uses JFreeChart for rendering. Deploy Pie Chart (2D or 3D) on your
page and point to a datasource XML file. Chart is re-rendered automatically when datasource file is modified.
thumbnail
Juan Fernández, módosítva 14 év-val korábban

RE: Chart portlet

Liferay Legend Bejegyzések: 1261 Csatlakozás dátuma: 2008.10.02. Legújabb bejegyzések
Rotsen Zerolf:
Is there a sample portlet displaying pie charts where all we have to do is pluging our data.

Hi!
the best example in Liferay is the Poll portlet, which uses JFreechart and has a few diagrams to choose.
I hope it will be helpful

Greetings
Rice Owl, módosítva 14 év-val korábban

RE: Chart portlet

Regular Member Bejegyzések: 177 Csatlakozás dátuma: 2009.04.24. Legújabb bejegyzések
Another option you could try is to use a servlet that outputs an image. Then in your JSP, you simply use the <img> tag, call the servlet, and it should render your graph. That way you can have a dynamically created chart fully integrated in your portlet.

The code for your servlet may look like:


response.setContentType("image/png");
JFreeChart myChart = .....;
OutputStream output = response.getOutputStream();
ChartUtilities.writeChartAsPNG(output, myChart, 100, 100);




So if you created a servlet called "MyGraphServlet", in your JSP code, you could simply use:

<img src="<path to servlet>/MyGraphServlet">


You could even pass variables to the servlet if you needed to.

Rotsen Zerolf:
Is there a sample portlet displaying pie charts where all we have to do is pluging our data.

I have been trying to create a portlet using Jfreechart but my knowledge of Java and portlets
creation is very bad.

Thanks,

rotseN
Bill Hazard, módosítva 14 év-val korábban

RE: Chart portlet

New Member Bejegyzés: 1 Csatlakozás dátuma: 2009.03.15. Legújabb bejegyzések
Rotsen - I like the servlet suggestion. I recently discovered Google Chart API which provides an excellent set of features. So maybe you don't even need to write the servlet!
Bill
thumbnail
Ahmed Hasan, módosítva 14 év-val korábban

RE: Chart portlet

Expert Bejegyzések: 306 Csatlakozás dátuma: 2007.04.13. Legújabb bejegyzések
I agree with Bill,

With Google Chart API, we dont even need a servlet or an API like JFreeChart. We are implementing Google chart API in one of our projects. In the earlier version of the same project to generate the charts we were using JFreeChart. We see a huge saving in terms of time and effort using Google chart API. It is cool, handy and quite flexible.

For any help feel free to contact me,

Ahmed Hasan
CTO, TransIT mPower Labs (P) Ltd.
info@mpowerglobal.com
mPower Global Inc.
A Liferay expert company.
thumbnail
Rick Bullotta, módosítva 14 év-val korábban

RE: Chart portlet

New Member Bejegyzések: 16 Csatlakozás dátuma: 2009.05.03. Legújabb bejegyzések
Ahmed Hasan:
I agree with Bill,

With Google Chart API, we dont even need a servlet or an API like JFreeChart. We are implementing Google chart API in one of our projects. In the earlier version of the same project to generate the charts we were using JFreeChart. We see a huge saving in terms of time and effort using Google chart API. It is cool, handy and quite flexible.



Hi, Ahmed.

One challenge with using the Google chart API, as I understand it, is that it requires that the server and application have access to the Internet and Google's servers for rendering content (e.g. it is not available offline for intranet or private network applications). Do you know if that is a correct assumption?

Thanks,

Rick
Rice Owl, módosítva 14 év-val korábban

RE: Chart portlet

Regular Member Bejegyzések: 177 Csatlakozás dátuma: 2009.04.24. Legújabb bejegyzések
Rick, you are right, in order to generate charts you need to be able to call the Google APIs. So your server would need access. Like you said, this can be problematic in intranet portals that may be "locked down" or there could be privacy issues as well. A company may not want to post certain data to an external service and in some cases may not be legal (such as HIPAA issues for medical records).
thumbnail
pruthvipatil raj, módosítva 10 év-val korábban

RE: Chart portlet

New Member Bejegyzések: 4 Csatlakozás dátuma: 2013.05.10. Legújabb bejegyzések
hello sir,

plz can you tell me how to do chart portlet in liferay.....
Vijayalakshmi B, módosítva 13 év-val korábban

RE: Chart portlet

New Member Bejegyzés: 1 Csatlakozás dátuma: 2011.03.18. Legújabb bejegyzések
Hi,

I need an example to create a portlet using JFree chart. How to render the chart generated on JSP page. Its urgent. Please help me. Thanks in advance

Viju
thumbnail
Dhandapani S, módosítva 12 év-val korábban

RE: Chart portlet

Regular Member Bejegyzések: 176 Csatlakozás dátuma: 2009.03.24. Legújabb bejegyzések
Hi Vijayalakshmi,

Why don't you use Google chart portlet, its very flexible compare to jfree chart.

Regards
Dhandapani S
thumbnail
Mani kandan, módosítva 12 év-val korábban

RE: Chart portlet

Expert Bejegyzések: 492 Csatlakozás dátuma: 2010.09.15. Legújabb bejegyzések
Hi all you can get the war file of Jfreechart. Take it out and modify it as per your requirement.

And also this will helpful for people who wants to use Jfreechart in future
Edi Wibowo, módosítva 12 év-val korábban

RE: Chart portlet

New Member Bejegyzés: 1 Csatlakozás dátuma: 2011.10.30. Legújabb bejegyzések
Please see an example at https://www.ibm.com/developerworks/mydeveloperworks/blogs/portlet/entry/chart_portlet?lang=en

Regards,
Edi Wibowo
Marat Gubaidullin, módosítva 7 év-val korábban

RE: Chart portlet

New Member Bejegyzés: 1 Csatlakozás dátuma: 2012.10.30. Legújabb bejegyzések
FYI. Chart portlet is published in Marketplace

https://web.liferay.com/marketplace/-/mp/application/48919330