hi oliver,

i checked it, and you are right,
its impossible to insert a chart into a hidden (display:none) element.
in this case the flotr library cant calculate the dimension of the chart

i have change the flotr code a bit, so if element is hidden, the dimension
is getting from style tag if set.
please get the latest trunk from t5components

2008/10/23 olip <[EMAIL PROTECTED]>

>
> have somebody had a look over it??
> Thank you
> Oliver
>
> olip wrote:
> >
> > I have got problems with the t5component chart when using in conjunction
> > with the t5 component tabset.
> >
> > As an example I use the code from the t5components site and make a test
> > site
> > with three tabs. the middle tab should contain a chart (also from the
> > examples on t5components)
> >
> > When running this code I get three empty tabs and I cannot switch between
> > them, it seems like the site "hangs". When I start the same code without
> > displaying the chart component in the middle tab it works just fine.
> >
> > The sample code works when using only the tabset or the chart.
> >
> > I am using tapestry 5
> >
> > Maybe those components interfere each other?
> >
> > Thanks for your help
> > Oliver
> >
> > ===================================
> > MyPage.java
> >
> > import org.apache.tapestry.commons.utils.XYDataItem;
> > import org.apache.tapestry.commons.components.Chart;
> > import org.apache.tapestry5.annotations.Component;
> > import org.apache.tapestry5.annotations.Cached;
> > import org.apache.tapestry5.annotations.Persist;
> > import org.apache.tapestry5.annotations.OnEvent;
> > import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
> > import org.apache.tapestry.commons.components.TabSet;
> >
> > import java.util.List;
> >
> >
> > public class MyPage {
> >     private List<List<XYDataItem>> _testData;
> >
> >     /**
> >      * simple chart
> >      */
> >     @Component(parameters = {"dataItems=testData"})
> >     private Chart _chart1;
> >
> >     /**
> >      * subclassed bar chart component
> >      */
> >     @Component
> >     private Chart _chart2;
> >
> >     /**
> >      * subclassed line chart component
> >      */
> >     @Component(parameters = {"dataItems=testData"})
> >     private Chart _chart3;
> >
> >     @Persist
> >     private String _activePanel;
> >
> >     /**
> >      * generating some data arrays
> >      */
> >     @Cached
> >     public List getTestData() {
> >         List<List<XYDataItem>> dataList = CollectionFactory.newList();
> >         List<XYDataItem> list1 = CollectionFactory.newList();
> >         List<XYDataItem> list2 = CollectionFactory.newList();
> >
> >         list1.add(new XYDataItem(0, 0.5));
> >         list1.add(new XYDataItem(1, 0.6));
> >         list1.add(new XYDataItem(2, 1.8));
> >         list1.add(new XYDataItem(3, 0.9));
> >         list1.add(new XYDataItem(4, 2));
> >
> >         list2.add(new XYDataItem(0, 1.5));
> >         list2.add(new XYDataItem(1, 2));
> >         list2.add(new XYDataItem(2, 4.5));
> >         list2.add(new XYDataItem(3, 3.5));
> >         list2.add(new XYDataItem(4, 5.5));
> >
> >         dataList.add(list1);
> >         dataList.add(list2);
> >
> >         return dataList;
> >     }
> >
> >     public String getActivePanel() {
> >         return _activePanel;
> >     }
> >
> >     public void setActivePanel(String activePanel) {
> >         _activePanel = activePanel;
> >     }
> >
> >     @OnEvent(component = "tabset", value = "action")
> >     public void onChange(String choosenPanelId) {
> >         _activePanel = choosenPanelId;
> >     }
> >
> >
> > }
> >
> >
> > ===========================================
> > MyPage.tml
> >
> > <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
> >     <body>
> >
> >         <div t:type="t5components/TabSet"
> > panelIds="list:'stuff1','stuff2','stuff3'" activePanelId="activePanel">
> >
> >             <div id="stuff1" style="display:none;">
> >                 <h1>Hello Guys and Dolls</h1>
> >             </div>
> >
> >             <div id="stuff2" style="display:none;">
> >                <div t:id="chart1" style="width: 350px; height: 150px;"/>
> >                 <br/>
> >                 <div t:id="chart2" style="width: 350px; height: 150px;"/>
> >                 <br/>
> >                 <div t:id="chart3" style="width: 350px; height: 150px;"/>
> >             </div>
> >
> >             <div id="stuff3" style="display:none;">
> >                 <h1>Hello World!</h1>
> >             </div>
> >
> >         </div>
> >     </body>
> > </html>
> >
> > ===================================================
> > MyPage.properties
> >
> >
> > label-stuff1 = introduction
> > label-stuff2 = chart
> > label-stuff3 = greetings
> >
> > ===================================================
> >
> >
> >
>
> --
> View this message in context:
> http://n2.nabble.com/-T5-t5component-Chart-interfere-with-TabSet-problem-tp1344812p1367160.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com

Reply via email to