[jboss-user] [JBoss Seam] - Re: JSF Chart Creator in Seam

swd847 do-not-reply at jboss.com
Wed Sep 19 22:16:42 EDT 2007


I have it working. My settings are as follows:

web.xml:

  |     <context-param>
  |         <param-name>facelets.LIBRARIES</param-name>
  |         <param-value>/WEB-INF/chartcreator.taglib.xml</param-value>
  |     </context-param>
  | 
  | <context-param>
  |       <param-name>net.sf.jsfcomp.chartcreator.USE_CHARTLET</param-name>
  | 		<param-value>false</param-value>
  | 	</context-param>
  | 

faces-config.xml


  | <component>
  | <component-type>net.sf.jsfcomp.chartcreator.component.UIChart</component-type>
  | <component-class>net.sf.jsfcomp.chartcreator.component.UIChart</component-class>
  | </component>
  |   
  |  <lifecycle>
  | <phase-listener>net.sf.jsfcomp.chartcreator.ChartListener</phase-listener>
  |    </lifecycle>
  | 
  | 

the backing bean for a line chart  (in a seam component called priceHome):


  | public TimeSeriesCollection getPriceDataSet() {
  | 		TimeSeries series = new TimeSeries("Price", Day.class);
  | 
  | 		List<Data> price = entityManager
  | 				.createQuery(
  | 						"from Data").getResultList();
  | 		for Data i : price) {
  | 			series.addOrUpdate(new Day(i.getDate()), i.getPrice());
  | 		}
  | 		
  | 		//         Add the series to your data set
  | 		TimeSeriesCollection dataset = new TimeSeriesCollection();
  | 		dataset.addSeries(series);
  | 		return dataset;
  | 	}
  | 

and in the Facelets page:


  | <c:chart id="price_chart" datasource="#{priceHome.priceDataSet}" type="timeseries" is3d="true" antialias="true" title="Pricing" xlabel="Date" ylabel="Price" height="350" width="500"></c:chart>
  | 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4086411#4086411

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4086411



More information about the jboss-user mailing list