Product Logos BridgeIt Services Banner
Drill down charts  XML
Forum Index -> Components
Author Message
jleslie_manh

Joined: 22/Jan/2007 00:00:00
Messages: 5
Offline


JFreeChart has a CustomURLGenerator that makes it quite easy to create drill down charts.

Does IceFaces chart have any similar functionality?
brad.kroeger

Joined: 26/Oct/2004 00:00:00
Messages: 298
Offline


I created a drill down pie2D chart that shows hitcount numbers on a website by top level navigation links, when you select a top level link piece of the chart, it fires an actionListener which causes the top level chart not to render and the subchart to render (The subchart has hitcount numbers on pages accessible from the top level selection):
Code:
                                 <ice:outputChart style="border: 1px solid #A3B9CF;" id="topLevelChart"
                                     rendered="#{!hitcount.subChartGenerated}"
                                     width="350"
                                     height="350"                                    
                                     type="pie2D"
                                     chartTitle="Home Page Statistics #{hitcount.startDate} To #{hitcount.endDate}"
                                     labels="#{hitcount.topLevel}"
                                     data="#{hitcount.topLevelData}"
                                     colors="#{hitcount.topLevelPaints}"
                                     actionListener="#{hitcount.action}"
                                     renderOnSubmit="#{hitcount.renderOnSubmit}"
                                     legendPlacement="right"
                                     legendColumns="1" />
 

Code:
                         <ice:panelGroup rendered="#{hitcount.subChartGenerated}">
                             <ice:commandButton  value="Top Level" actionListener="#{hitcount.backToTopLevel}" />
                                 <ice:outputChart style="border: 1px solid #A3B9CF;" id="subChart"
                                     width="350"
                                     height="350"
                                     type="pie2D"
                                     chartTitle="Sub Menu Statistics #{hitcount.lastSelected} #{hitcount.startDate} To #{hitcount.endDate}"
                                     labels="#{hitcount.subLabels}"
                                     data="#{hitcount.subData}"
                                     colors="#{hitcount.subPaints}"
                                     renderOnSubmit="#{hitcount.subRenderOnSubmit}"
                                     legendPlacement="right"
                                     legendColumns="1" />
                         </ice:panelGroup>


Here are the two actionListeners used in this scenario:
Code:
     public void action(ActionEvent event) {
         if (event.getSource() instanceof OutputChart) {
             OutputChart chart = (OutputChart) event.getSource();
             if (chart.getClickedImageMapArea().getLengendLabel() != null) {
                 setClickedAreaValue(chart.getClickedImageMapArea().getLengendLabel() + " " +
                                                                     chart.getClickedImageMapArea()
                                                                             .getValue());
                 renderSubChart(chart.getClickedImageMapArea().getLengendLabel());
             }
         }
     }
 
 
     private String lastSelected = "";
     private boolean subChartGenerated = false;
     private void renderSubChart(String topLevelLabel){
         if(!lastSelected.equals(topLevelLabel)){
             subClickedAreaValue = "";
             subPieNeedsRendering = true;
         }
         lastSelected = topLevelLabel;
         subChartGenerated = true;
         if(topLevelLabel.equals(PRODUCT_OVERVIEW)){
             subLabels = product;
             subData = productData;
             subPaints = productPaints;
         }else if(topLevelLabel.equals(OS_DOWNLOADS)){
             subLabels = downloads;
             subData = downloadsData;
             subPaints = downloadsPaints;
 // The else if statements continue, one for each top level category.
 // All of the top level data and sub data were generated at the same time in the bean.
         }else{
             subChartGenerated = false;
         }
     }
 


Code:
     public void backToTopLevel(ActionEvent event) {
         subChartGenerated = false;
     }
 



Brad Kroeger
Developer
ICEsoft Technologies, Inc.
[Email]
brad.kroeger

Joined: 26/Oct/2004 00:00:00
Messages: 298
Offline


I should also mention that although we have not set a specific date, creating an outputChart component using JFreeChart is on our component roadmap.

Brad Kroeger
Developer
ICEsoft Technologies, Inc.
[Email]
mplante

Joined: 14/Sep/2007 00:00:00
Messages: 10
Offline


When can we expect that?
TedByers

Joined: 08/May/2007 00:00:00
Messages: 23
Offline


mplante wrote:
I should also mention that although we have not set a specific date, creating an outputChart component using JFreeChart is on our component roadmap. 


I was wondering about that, and was going to ask what to do to do precisely that when I saw your last message on this thread. You see, I am presently working on a couple standalone and web applications using jFreeChart, and to my disappointment you have your chart components using a much more primitive, much less mature, charting library.

If you are going to have support for creating charts using jFreeChart RSN, then I may wait for you to do it. Other wise, I would ask you to tell me precisely what needs to be done in order to generate the charts using jFreeChart, and to support all the dynamic complexity jFreeChart supports in standalone applications. Further, I would ask you to take a quick look at the beta charts on finance.yahoo.com, and tell me roughly what it would take to reproduce especially their support for crosshairs and for dynamically selecting the date interval used to define the domain axis. My intent is to make a UI that is MUCH more user friendly and flexible (using much of what ICEFaces has to offer).

While I have yet to begin to sort out the UI design, I am very interested in using your partial submit on, e.g. a selection control or on a table, and have the act of selection along with the id of what is selected update the chart as required. And date selection along with crosshair functionality is of considerable importance to us, almost to the point of considering using an applet along with Swing controls to handle this functionality.

Your thoughts and advice on this would begreatly appreciated.

Thanks

Ted
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2979
Offline


Hi,

You can use JFreeCharts with ICEfaces right now with the JSF Comp - ChartCreator component. I've attached an example of this with ICEfaces. For more info on the component, please see their site.

Thanks,
Philip
 Filename Test_ChartCreator.war [Disk] Download
 Description Test case war showing ChartCreator/JFreeChart working in an ICEfaces page
 Filesize 6747 Kbytes
 Downloaded:  391 time(s)


.
TedByers

Joined: 08/May/2007 00:00:00
Messages: 23
Offline


Thanks Philip,

Two things.

1) Your sample worked fine in Tomcat 5.5 but crashed and burned in Tomcat 6. Why? I thought the problems with ICEfaces apps running in Tomcat 6 were resolved early last summer. Since I run both, as well as the most recent glassfish distribution, how can I set things up so I can put an application war on any of the three and be sure it will work? Can you provide an url to pages on your website that detail how best to get ICEFaces to work well with the different servers?

2) I notice on your sample, there are no dynamic charts, but in your components showcase you do. Is the latter specific to jchart or can I get the dynamic capabilities in jFreeChart (such as the crosshair and tooltips). If I were using merely a servlet with JSP, I would use jFreeChart to create a clientside map and tooltips in Javascript. Is use of a clientside map and tooltips still an option with your chart component, or does your component provide a better option?

Thanks

Ted
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2979
Offline


Ted,

All of our App server deployment guides can be found here. You'll have to make some slight adjustments to the war to get it to run on Tomcat 6.

Philip

.
TedByers

Joined: 08/May/2007 00:00:00
Messages: 23
Offline


Thanks Philip.

I take it, then, that using this in NetBeans, I can simplify things by defining three ICEFaces libraries; one each for Tomcat 5.5, Tomcat 6, and Glassfish, and include the appropriate librry for the intended target platform. Right?

Ted
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2979
Offline


Sure, that would be a good idea.

.
dprobst2

Joined: 21/Jan/2008 00:00:00
Messages: 5
Offline


Hi there,

I have a problem in getting chartcreator display my chart. I have a DefaultPieDataset loaded in the bean and using


Code:
<ice:form 
     xmlns:h="http://java.sun.com/jsf/html" 
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:c="http://java.sun.com/jstl/core" 
     xmlns:ice="http://www.icesoft.com/icefaces/component"
     xmlns:ui="http://java.sun.com/jsf/facelets" styleClass="crisisForm" id="chartForm"
     xmlns:fn="http://java.sun.com/jsp/jstl/functions"
     xmlns:chart="http://sourceforge.net/projects/jsf-comp" 
     partialSubmit="true"
     >
     
 
 
     <ice:panelPopup draggable="true" resizable="true"
         rendered="#{marketIndicatorPreviewMB.chartgenerator.chartPanelVisible}"
         visible="#{marketIndicatorPreviewMB.chartgenerator.chartPanelVisible}" style="width:550px; height:400px">
 
         <f:facet name="header">
             <ice:panelGrid width="100%" cellpadding="0" cellspacing="0" columns="2"
                 style="text-align: center; vertical-align: bottom;">
                 <ice:outputText value="rise 'n' shine"/>
                 <ice:commandButton image="../images/close.gif"
                     actionListener="#{marketIndicatorPreviewMB.chartgenerator.closeChartPanelAction}"
                     style="vertical-align: bottom"/>
             </ice:panelGrid>
         </f:facet>
 
         <f:facet name="body">
             <ice:panelGrid width="100%" cellpadding="0" cellspacing="0" columns="1">
 
 
                 <ice:selectOneMenu id="daysDropDown" value="#{marketIndicatorPreviewMB.visibleDay}"
                     valueChangeListener="#{marketIndicatorPreviewMB.changeVisibleDayAction}"
                     styleClass="dropdownMenu" partialSubmit="false">
                     <f:selectItems id="chartDays" value="#{marketIndicatorPreviewMB.dayItemList}"/>
                 </ice:selectOneMenu>
 
   
 
                 <chart:chart datasource="#{marketIndicatorPreviewMB.chartgenerator.chartData}" type="pie"
                     title="TestChart"  ></chart:chart>
 
             </ice:panelGrid>
         </f:facet>
     </ice:panelPopup>
 
 
 
 </ice:form>



the getter method of the dataset is called, but I don't get the chat displayed. On the screen I get the red cross from ie indicating a image that couldn't be loaded.

web.xml settings for PhaseListener
I'm using foo.xhtml pages here

I've been messing with this since quite a while now.

I'd highly appreciate any hints

thanks

Dennis
dprobst2

Joined: 21/Jan/2008 00:00:00
Messages: 5
Offline


I've found a solution..

I'm using the chartlet configuration.. for some reason that one works now.

moultonr

Joined: 10/May/2009 00:00:00
Messages: 3
Offline


Any one done a dual axis chart using jFreeChart?

I looked through all the tag and I can't find any thing that helps with that.

Thanks
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team