Foros de discusión

Chart portlet

thumbnail
Rotsen Zerolf, modificado hace 16 años.

Chart portlet

Junior Member Mensajes: 28 Fecha de incorporación: 16/01/08 Mensajes recientes
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, modificado hace 16 años.

RE: Chart portlet

New Member Mensajes: 9 Fecha de incorporación: 20/09/07 Mensajes recientes
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, modificado hace 16 años.

RE: Chart portlet

Junior Member Mensajes: 28 Fecha de incorporación: 16/01/08 Mensajes recientes
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, modificado hace 16 años.

RE: Chart portlet

Junior Member Mensajes: 28 Fecha de incorporación: 16/01/08 Mensajes recientes
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, modificado hace 16 años.

RE: Chart portlet

New Member Mensajes: 9 Fecha de incorporación: 20/09/07 Mensajes recientes
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, modificado hace 16 años.

RE: Chart portlet

Junior Member Mensajes: 28 Fecha de incorporación: 16/01/08 Mensajes recientes
I will try that.

Gracias,

rotseN
thumbnail
Rotsen Zerolf, modificado hace 16 años.

RE: Chart portlet

Junior Member Mensajes: 28 Fecha de incorporación: 16/01/08 Mensajes recientes
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, modificado hace 16 años.

RE: Chart portlet

Liferay Legend Mensajes: 1228 Fecha de incorporación: 14/04/08 Mensajes recientes
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, modificado hace 14 años.

RE: Chart portlet

Liferay Legend Mensajes: 1261 Fecha de incorporación: 2/10/08 Mensajes recientes
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, modificado hace 14 años.

RE: Chart portlet

Regular Member Mensajes: 177 Fecha de incorporación: 24/04/09 Mensajes recientes
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, modificado hace 14 años.

RE: Chart portlet

New Member Mensaje: 1 Fecha de incorporación: 15/03/09 Mensajes recientes
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, modificado hace 14 años.

RE: Chart portlet

Expert Mensajes: 306 Fecha de incorporación: 13/04/07 Mensajes recientes
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, modificado hace 14 años.

RE: Chart portlet

New Member Mensajes: 16 Fecha de incorporación: 3/05/09 Mensajes recientes
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, modificado hace 14 años.

RE: Chart portlet

Regular Member Mensajes: 177 Fecha de incorporación: 24/04/09 Mensajes recientes
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, modificado hace 10 años.

RE: Chart portlet

New Member Mensajes: 4 Fecha de incorporación: 10/05/13 Mensajes recientes
hello sir,

plz can you tell me how to do chart portlet in liferay.....
Vijayalakshmi B, modificado hace 13 años.

RE: Chart portlet

New Member Mensaje: 1 Fecha de incorporación: 18/03/11 Mensajes recientes
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, modificado hace 12 años.

RE: Chart portlet

Regular Member Mensajes: 176 Fecha de incorporación: 24/03/09 Mensajes recientes
Hi Vijayalakshmi,

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

Regards
Dhandapani S
thumbnail
Mani kandan, modificado hace 12 años.

RE: Chart portlet

Expert Mensajes: 492 Fecha de incorporación: 15/09/10 Mensajes recientes
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, modificado hace 12 años.

RE: Chart portlet

New Member Mensaje: 1 Fecha de incorporación: 30/10/11 Mensajes recientes
Please see an example at https://www.ibm.com/developerworks/mydeveloperworks/blogs/portlet/entry/chart_portlet?lang=en

Regards,
Edi Wibowo
Marat Gubaidullin, modificado hace 7 años.

RE: Chart portlet

New Member Mensaje: 1 Fecha de incorporación: 30/10/12 Mensajes recientes
FYI. Chart portlet is published in Marketplace

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