Re: JFreeChart with CF [spamtrap bayes][spamtrap heur]
Dear Paul, Your help has proved very vital for me using jFreeCharts. Now I have another query. Using your method I can display the value of each bar. The problem is, that value is displayed inside the bar, however, I want to display it just on top (but outside) the bars so that if 1 bar has a magnitude of 100 and the other has a magnitude of 1, text for both is visible. Please let me know how that is possible. Thanks in advance. Regards, Arsalan -- From: Arsalan Tariq Keen arsalk...@hotmail.com Sent: Wednesday, April 07, 2010 4:26 AM To: cf-talk cf-talk@houseoffusion.com Subject: Re: JFreeChart with CF [spamtrap bayes][spamtrap heur] the method is actually setMaximumBarWidth(percent double) :) Works fine!! -- From: Arsalan Tariq Keen arsalk...@hotmail.com Sent: Wednesday, April 07, 2010 3:07 AM To: cf-talk cf-talk@houseoffusion.com Subject: Re: JFreeChart with CF [spamtrap bayes][spamtrap heur] Hey Paul, One more thing... I want to restrict the bar width to particular size. I searched the net and got this funtion. renderer.setMaxBarWidth(0.10); but its not working. Its giving the following error as usual :( No matching Method/Function for org.jfree.chart.renderer.category.BarRenderer3D.SETMAXBARWIDTH(numeric) found any clues? Regards, Arsalan -- From: Paul Hastings p...@sustainablegis.com Sent: Tuesday, April 06, 2010 9:45 AM To: cf-talk cf-talk@houseoffusion.com Subject: Re: JFreeChart with CF [spamtrap bayes][spamtrap heur] On 4/6/2010 8:45 AM, Arsalan Tariq Keen wrote: Paul, your code works... its showing labels! However, its showing 'php sucks1!' and 'php sucks 2!' in the label. Whereas, I want to display the actual value of each bar, which in your example would be 1,5,3,2,3,2. What shall I change in this code? change: itemLabelGenerator=createObject(java,org.jfree.chart.labels.StandardCategoryItemLabelGenerator).init( php sucks {0}!,nf); to: itemLabelGenerator=createObject(java,org.jfree.chart.labels.StandardCategoryItemLabelGenerator).init( {0},nf); look at the java docs for NumberFormat DateFormat if you need to format the values. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333102 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: JFreeChart with CF [spamtrap bayes][spamtrap heur]
Hey Paul, One more thing... I want to restrict the bar width to particular size. I searched the net and got this funtion. renderer.setMaxBarWidth(0.10); but its not working. Its giving the following error as usual :( No matching Method/Function for org.jfree.chart.renderer.category.BarRenderer3D.SETMAXBARWIDTH(numeric) found any clues? Regards, Arsalan -- From: Paul Hastings p...@sustainablegis.com Sent: Tuesday, April 06, 2010 9:45 AM To: cf-talk cf-talk@houseoffusion.com Subject: Re: JFreeChart with CF [spamtrap bayes][spamtrap heur] On 4/6/2010 8:45 AM, Arsalan Tariq Keen wrote: Paul, your code works... its showing labels! However, its showing 'php sucks1!' and 'php sucks 2!' in the label. Whereas, I want to display the actual value of each bar, which in your example would be 1,5,3,2,3,2. What shall I change in this code? change: itemLabelGenerator=createObject(java,org.jfree.chart.labels.StandardCategoryItemLabelGenerator).init( php sucks {0}!,nf); to: itemLabelGenerator=createObject(java,org.jfree.chart.labels.StandardCategoryItemLabelGenerator).init( {0},nf); look at the java docs for NumberFormat DateFormat if you need to format the values. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332663 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: JFreeChart with CF [spamtrap bayes][spamtrap heur]
the method is actually setMaximumBarWidth(percent double) :) Works fine!! -- From: Arsalan Tariq Keen arsalk...@hotmail.com Sent: Wednesday, April 07, 2010 3:07 AM To: cf-talk cf-talk@houseoffusion.com Subject: Re: JFreeChart with CF [spamtrap bayes][spamtrap heur] Hey Paul, One more thing... I want to restrict the bar width to particular size. I searched the net and got this funtion. renderer.setMaxBarWidth(0.10); but its not working. Its giving the following error as usual :( No matching Method/Function for org.jfree.chart.renderer.category.BarRenderer3D.SETMAXBARWIDTH(numeric) found any clues? Regards, Arsalan -- From: Paul Hastings p...@sustainablegis.com Sent: Tuesday, April 06, 2010 9:45 AM To: cf-talk cf-talk@houseoffusion.com Subject: Re: JFreeChart with CF [spamtrap bayes][spamtrap heur] On 4/6/2010 8:45 AM, Arsalan Tariq Keen wrote: Paul, your code works... its showing labels! However, its showing 'php sucks1!' and 'php sucks 2!' in the label. Whereas, I want to display the actual value of each bar, which in your example would be 1,5,3,2,3,2. What shall I change in this code? change: itemLabelGenerator=createObject(java,org.jfree.chart.labels.StandardCategoryItemLabelGenerator).init( php sucks {0}!,nf); to: itemLabelGenerator=createObject(java,org.jfree.chart.labels.StandardCategoryItemLabelGenerator).init( {0},nf); look at the java docs for NumberFormat DateFormat if you need to format the values. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332669 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
JFreeChart with CF
Hi Experts, Does anyone have any idea of using JFreeChart with CF. I am using the custom tage provided by Dave Gilbert, but I also want to display the ItemLabel on each bar of my barchart I.e, the value of each bar. Can anyone help. I am really fed up of trying and failing Regards, Arsalan ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332565 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: JFreeChart with CF [spamtrap bayes][spamtrap heur]
On 4/5/2010 5:51 PM, Arsalan Tariq Keen wrote: Does anyone have any idea of using JFreeChart with CF. I am using the custom tage provided by Dave Gilbert, but I also want to display the ItemLabel on each bar of my barchart I.e, the value of each bar. Can anyone help. I am really fed up of trying and failing we use it (the raw java lib) all the time. what's the problem? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332566 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: JFreeChart with CF [spamtrap bayes][spamtrap heur]
Oh my God ... I am so happy to see this reply :D Well the problem is ... I have managed to create Bar3D graph. Now, what I want is, the value of each bar, should be displayed on top of it. For example if a bar is denoting magnitude '4', then '4' should be written on top of it. How can I do that? Regards, Arsalan -- From: Paul Hastings p...@sustainablegis.com Sent: Monday, April 05, 2010 4:20 PM To: cf-talk cf-talk@houseoffusion.com Subject: Re: JFreeChart with CF [spamtrap bayes][spamtrap heur] On 4/5/2010 5:51 PM, Arsalan Tariq Keen wrote: Does anyone have any idea of using JFreeChart with CF. I am using the custom tage provided by Dave Gilbert, but I also want to display the ItemLabel on each bar of my barchart I.e, the value of each bar. Can anyone help. I am really fed up of trying and failing we use it (the raw java lib) all the time. what's the problem? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332567 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: JFreeChart with CF [spamtrap bayes][spamtrap heur]
On 4/5/2010 8:01 PM, Arsalan Tariq Keen wrote: How can I do that? what ver of jfreechart are you using? this works with the latest (1.0.13): cfscript color=createObject(java,java.awt.Color); plotOrientation=createObject(java,org.jfree.chart.plot.PlotOrientation); nf=createObject(java,java.text.NumberFormat).getInstance(); /* pay attention: label format, format where format is either some instance of NumberFormat or DateFormat leave you to fiddle w/placement,formatting, etc. */ itemLabelGenerator=createObject(java,org.jfree.chart.labels.StandardCategoryItemLabelGenerator).init( php sucks {0}!,nf); dataset=createObject(java,org.jfree.data.category.DefaultCategoryDataset).init(); dataset.addValue(1.0, 1, Column 1); dataset.addValue(5.0, 1, Column 2); dataset.addValue(3.0, 1, Column 3); dataset.addValue(2.0, 2, Column 1); dataset.addValue(3.0, 2, Column 2); dataset.addValue(2.0, 2, Column 3); chart=createObject(java,org.jfree.chart.ChartFactory).createBarChart3D( it's a bar chart stupid, // title category, // domain axis label value,// range axis label dataset,// which data plotOrientation.VERTICAL, // direction false, // legend false, // tooltips false // urls ); chart.setBackgroundPaint(Color.white); // plot plot=chart.getCategoryPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setRangeGridlinePaint(Color.white); // renderer renderer=plot.getRenderer(); renderer.setSeriesPaint(0,color.gray); renderer.setSeriesPaint(1,color.orange); renderer.setDrawBarOutline(false); renderer.setItemMargin(0.0); renderer.setItemLabelPaint(color.red); renderer.setItemLabelsVisible(javacast(boolean,true)); renderer.setItemLabelGenerator(itemLabelGenerator); // axis categoryAxis = plot.getDomainAxis(); categoryAxis.setCategoryMargin(0.0); // wrap it up chartImage=chart.createBufferedImage(650,450); imageIO=createObject(java,javax.imageio.ImageIO); outFile=createObject(java,java.io.File); // some write accessible path outFile.init(path_to_image_file\labels.png); imageIO.write(chartImage,png,outFile); /cfscript img src=labels.png ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332587 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: JFreeChart with CF [spamtrap bayes][spamtrap heur]
Paul, your code works... its showing labels! However, its showing 'php sucks1!' and 'php sucks 2!' in the label. Whereas, I want to display the actual value of each bar, which in your example would be 1,5,3,2,3,2. What shall I change in this code? Regards, Arsalan -- From: Paul Hastings p...@sustainablegis.com Sent: Monday, April 05, 2010 10:42 PM To: cf-talk cf-talk@houseoffusion.com Subject: Re: JFreeChart with CF [spamtrap bayes][spamtrap heur] On 4/5/2010 8:01 PM, Arsalan Tariq Keen wrote: How can I do that? what ver of jfreechart are you using? this works with the latest (1.0.13): cfscript color=createObject(java,java.awt.Color); plotOrientation=createObject(java,org.jfree.chart.plot.PlotOrientation); nf=createObject(java,java.text.NumberFormat).getInstance(); /* pay attention: label format, format where format is either some instance of NumberFormat or DateFormat leave you to fiddle w/placement,formatting, etc. */ itemLabelGenerator=createObject(java,org.jfree.chart.labels.StandardCategoryItemLabelGenerator).init( php sucks {0}!,nf); dataset=createObject(java,org.jfree.data.category.DefaultCategoryDataset).init(); dataset.addValue(1.0, 1, Column 1); dataset.addValue(5.0, 1, Column 2); dataset.addValue(3.0, 1, Column 3); dataset.addValue(2.0, 2, Column 1); dataset.addValue(3.0, 2, Column 2); dataset.addValue(2.0, 2, Column 3); chart=createObject(java,org.jfree.chart.ChartFactory).createBarChart3D( it's a bar chart stupid, // title category, // domain axis label value, // range axis label dataset, // which data plotOrientation.VERTICAL, // direction false, // legend false, // tooltips false // urls ); chart.setBackgroundPaint(Color.white); // plot plot=chart.getCategoryPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setRangeGridlinePaint(Color.white); // renderer renderer=plot.getRenderer(); renderer.setSeriesPaint(0,color.gray); renderer.setSeriesPaint(1,color.orange); renderer.setDrawBarOutline(false); renderer.setItemMargin(0.0); renderer.setItemLabelPaint(color.red); renderer.setItemLabelsVisible(javacast(boolean,true)); renderer.setItemLabelGenerator(itemLabelGenerator); // axis categoryAxis = plot.getDomainAxis(); categoryAxis.setCategoryMargin(0.0); // wrap it up chartImage=chart.createBufferedImage(650,450); imageIO=createObject(java,javax.imageio.ImageIO); outFile=createObject(java,java.io.File); // some write accessible path outFile.init(path_to_image_file\labels.png); imageIO.write(chartImage,png,outFile); /cfscript img src=labels.png ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332609 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: JFreeChart with CF [spamtrap bayes][spamtrap heur]
Thanks Paul... I made the changes myself. Now I have what I wanted. Thanks man. Couldn't have done it without your help. Regards, Arsalan -- From: Arsalan Tariq Keen arsalk...@hotmail.com Sent: Tuesday, April 06, 2010 6:45 AM To: cf-talk cf-talk@houseoffusion.com Subject: Re: JFreeChart with CF [spamtrap bayes][spamtrap heur] Paul, your code works... its showing labels! However, its showing 'php sucks1!' and 'php sucks 2!' in the label. Whereas, I want to display the actual value of each bar, which in your example would be 1,5,3,2,3,2. What shall I change in this code? Regards, Arsalan -- From: Paul Hastings p...@sustainablegis.com Sent: Monday, April 05, 2010 10:42 PM To: cf-talk cf-talk@houseoffusion.com Subject: Re: JFreeChart with CF [spamtrap bayes][spamtrap heur] On 4/5/2010 8:01 PM, Arsalan Tariq Keen wrote: How can I do that? what ver of jfreechart are you using? this works with the latest (1.0.13): cfscript color=createObject(java,java.awt.Color); plotOrientation=createObject(java,org.jfree.chart.plot.PlotOrientation); nf=createObject(java,java.text.NumberFormat).getInstance(); /* pay attention: label format, format where format is either some instance of NumberFormat or DateFormat leave you to fiddle w/placement,formatting, etc. */ itemLabelGenerator=createObject(java,org.jfree.chart.labels.StandardCategoryItemLabelGenerator).init( php sucks {0}!,nf); dataset=createObject(java,org.jfree.data.category.DefaultCategoryDataset).init(); dataset.addValue(1.0, 1, Column 1); dataset.addValue(5.0, 1, Column 2); dataset.addValue(3.0, 1, Column 3); dataset.addValue(2.0, 2, Column 1); dataset.addValue(3.0, 2, Column 2); dataset.addValue(2.0, 2, Column 3); chart=createObject(java,org.jfree.chart.ChartFactory).createBarChart3D( it's a bar chart stupid, // title category, // domain axis label value, // range axis label dataset, // which data plotOrientation.VERTICAL, // direction false, // legend false, // tooltips false // urls ); chart.setBackgroundPaint(Color.white); // plot plot=chart.getCategoryPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setRangeGridlinePaint(Color.white); // renderer renderer=plot.getRenderer(); renderer.setSeriesPaint(0,color.gray); renderer.setSeriesPaint(1,color.orange); renderer.setDrawBarOutline(false); renderer.setItemMargin(0.0); renderer.setItemLabelPaint(color.red); renderer.setItemLabelsVisible(javacast(boolean,true)); renderer.setItemLabelGenerator(itemLabelGenerator); // axis categoryAxis = plot.getDomainAxis(); categoryAxis.setCategoryMargin(0.0); // wrap it up chartImage=chart.createBufferedImage(650,450); imageIO=createObject(java,javax.imageio.ImageIO); outFile=createObject(java,java.io.File); // some write accessible path outFile.init(path_to_image_file\labels.png); imageIO.write(chartImage,png,outFile); /cfscript img src=labels.png ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332612 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: JFreeChart with CF [spamtrap bayes][spamtrap heur]
On 4/6/2010 8:45 AM, Arsalan Tariq Keen wrote: Paul, your code works... its showing labels! However, its showing 'php sucks1!' and 'php sucks 2!' in the label. Whereas, I want to display the actual value of each bar, which in your example would be 1,5,3,2,3,2. What shall I change in this code? change: itemLabelGenerator=createObject(java,org.jfree.chart.labels.StandardCategoryItemLabelGenerator).init( php sucks {0}!,nf); to: itemLabelGenerator=createObject(java,org.jfree.chart.labels.StandardCategoryItemLabelGenerator).init( {0},nf); look at the java docs for NumberFormat DateFormat if you need to format the values. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332623 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: jfreechart
Anyone use CF with jfreechart? I'm trying to create a MeterPlot, but it's coming up blank. Yes, but we don't use MeterPlot. I'd RTFM if there was a better FM :) I know what you mean. Have you tried the forum? I've always managed to get answers there. http://www.jfree.org/phpBB2/viewforum.php?f=3 Nick ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:245642 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
jfreechart
Anyone use CF with jfreechart? I'm trying to create a MeterPlot, but it's coming up blank. I'd RTFM if there was a better FM :) -seth == Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html == ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:245593 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54