You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk> on 2008/07/01 07:39:46 UTC

Re: Wikcet Freechart and SVG

Ahh okay, then you need to create a panel or something(maybe do it like 
image itself just copy the source and make it attachable to embed) that 
contains the embed...

Manuel Corrales wrote:
> Sorry for my stupidity :(
>
> Ive tried your code, and as said before, the svg is being generated 
> ok, but it is not displayed on the browser (attached an image of the 
> page). When i right click on the broken image icon, and press save as, 
> i can download the svg.
>
> For what i was reading, i dont think it is possible to include a svg 
> image in a <img> tag, i think only <embed> <object> and <iframe> can 
> have an svg image.
>
> Anyway, i will keep looking for a solution.
>
> Thanks!
>
> On Mon, Jun 30, 2008 at 5:36 PM, Manuel Corrales 
> <manuelcorrales@gmail.com <ma...@gmail.com>> wrote:
>
>     I am going to try your code as soon as i can, but i still don't
>     understand where are you generating the svg image on this code.
>
>
>     On Mon, Jun 30, 2008 at 1:59 PM, Nino Saturnino Martinez Vazquez
>     Wael <nino.martinez@jayway.dk <ma...@jayway.dk>> wrote:
>
>         hmm whats JFreeChart image?
>
>
>         I usually do this, in my domain classes :
>
>               JFreeChart chart = ChartFactory
>                       .createTimeSeriesChart(
>                              
>         Messages.getString("ReportWeightChart.5", locale),
>         Messages.getString("ReportWeightChart.6", locale),
>         Messages.getString("ReportWeightChart.7", locale), dataset,
>         true, true, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
>               return chart.createBufferedImage(500, 270);
>
>         And this in the wicket page :
>
>                       Report simpleReport = (Report)
>         item.getModelObject();
>
>                       BufferedImage report =
>         simpleReport.getReport(getLocale());
>                       ImageResource imageResource = new
>         ImageResource(report);
>                       item.add(new Image("image", imageResource));
>
>
>         Ahh, I see you are mixing things(found the JFreeChart on the
>         wiki).. You cant do it like that it should be like
>         this(although the otherway can also be done):
>
>
>         JFreeChart chart = ChartFactory.createPieChart("Resumen de
>         gastos",
>                       dataSet, true, true, false);
>               PiePlot plot = (PiePlot) chart.getPlot();
>               plot.setSectionOutlinesVisible(false);
>               add(new Image("image",chart.createBufferedImage(640,
>         480)));
>
>
>
>
>
>         Manuel Corrales wrote:
>
>             Here is the page code: (this is all prototype code, just
>             messing around with
>             graphics on wicket)
>
>             JFreeChart chart = ChartFactory.createPieChart("Resumen de
>             gastos",
>                            dataSet, true, true, false);
>                    PiePlot plot = (PiePlot) chart.getPlot();
>                    plot.setSectionOutlinesVisible(false);
>                    add(new Image("image",new JFreeChartImage("image",
>             chart, 640,
>             480)));
>
>             Thanks a lot!!
>
>             On Mon, Jun 30, 2008 at 11:36 AM, Nino Saturnino Martinez
>             Vazquez Wael <
>             nino.martinez@jayway.dk <ma...@jayway.dk>>
>             wrote:
>
>              
>
>                 Manuel Corrales wrote:
>
>                    
>
>                     Yes, i know, but i have tried with firefox and
>                     opera. Also to implement
>                     the
>                     <object> solution i have to write the image to the
>                     disc first and then
>                     dynamically set the data attribute on the object tag.
>
>                     Nino: what do you mean by where is the page? If i
>                     can see a non SVG image
>                     with exactly the same page, shouldn't i be able to
>                     see an SVG image?
>
>
>
>                          
>
>                 I just wanted to see how you implemented it in the
>                 page... Both java and
>                 html (just to double check)... And I saw the part
>                 about some browsers not
>                 handling svg very good.
>
>                    
>
>                     Best regards.
>
>                     On Mon, Jun 30, 2008 at 9:24 AM, Federico Fanton
>                     <ffanton@ibc.it <ma...@ibc.it>> wrote:
>
>
>
>                          
>
>                         On Sun, 29 Jun 2008 21:03:29 -0300
>                         "Manuel Corrales" <manuelcorrales@gmail.com
>                         <ma...@gmail.com>> wrote:
>
>
>
>                                
>
>                             Hey, great!! But still having issues,
>                             sorry to bother you again. Now i
>
>
>                                      
>
>                         added
>
>
>                                
>
>                             the svg to the page, but the browser do
>                             not display it. The image is
>
>
>                                      
>
>                         there,
>
>
>                                
>
>                             because when i right click the broken
>                             image that is displayed by the
>
>
>                                      
>
>                         broser
>
>
>                                
>
>                             and press save as, i can save the svg and
>                             is good. Should my html tag be
>                             different, or should i set something else
>                             on my code:
>
>
>                                      
>
>                         Not every browser handles SVGs directly, some
>                         need a plugin (guess which
>                         one :) ).. In our project I use the <object
>                         .../> tag, so for example
>                         when
>                         the page is rendered it has a
>
>                         <object style="height: 32px; width: 32px;"
>                         data="images/logo.svg"/>
>
>                         Bye!
>
>
>                         ---------------------------------------------------------------------
>                         To unsubscribe, e-mail:
>                         users-unsubscribe@wicket.apache.org
>                         <ma...@wicket.apache.org>
>                         For additional commands, e-mail:
>                         users-help@wicket.apache.org
>                         <ma...@wicket.apache.org>
>
>
>
>
>                                
>
>
>                          
>
>                 --
>                 -Wicket for love
>
>                 Nino Martinez Wael
>                 Java Specialist @ Jayway DK
>                 http://www.jayway.dk
>                 +45 2936 7684
>
>
>                 ---------------------------------------------------------------------
>                 To unsubscribe, e-mail:
>                 users-unsubscribe@wicket.apache.org
>                 <ma...@wicket.apache.org>
>                 For additional commands, e-mail:
>                 users-help@wicket.apache.org
>                 <ma...@wicket.apache.org>
>
>
>                    
>
>
>              
>
>
>         -- 
>         -Wicket for love
>
>         Nino Martinez Wael
>         Java Specialist @ Jayway DK
>         http://www.jayway.dk
>         +45 2936 7684
>
>
>         ---------------------------------------------------------------------
>         To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>         <ma...@wicket.apache.org>
>         For additional commands, e-mail: users-help@wicket.apache.org
>         <ma...@wicket.apache.org>
>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org