JfreeChartWrapper not displaying chart

Hi, there indeed seems to be a regression with 7.3.X series. I’ll see if I can make a workaround for this.

We had the same problem with 7.3.10. With 7.3.8 it works fine.

Thanks Matti and have a nice weekend

Thanks, this may help, sounds like a brand new regression :frowning:

This looks like a regression in Vaadin core to me. A workaround is to call markAsDirty for the component after it is attached. Quick fix:

        JFreeChartWrapper jFreeChartWrapper = new JFreeChartWrapper(chart) {

            @Override
            public void attach() {
                super.attach();
                markAsDirty();
            }
            
        };

Hi Matti,

I tried your suggestion (Vaadin 7.3.10) but it doesn’t help wether in my application nor in the test case of the addon. With Vaadin 7.3.8 both are working as expected.

Yes, my bad, I made a mistake when searching for a workaround. Try this one:

        JFreeChartWrapper jFreeChartWrapper = new JFreeChartWrapper(jfreechart) {

                    @Override
                    public void attach() {
                        super.attach();
                        setResource("src", getSource());
                    }
                };

Great!
Now it works with Vaadin 7.3.10.

Thanks again

Perfect solution also for me. !!
Thanks

Thanks you for this !

Work like charmed… :slight_smile:
Thank you…

Thank you. :slight_smile:

I use vaadin 7.5.8 and jfreechartwrapper 3.0.2 and didn’t see the chart too. Has anybody an idea?
Or which versions must I use that it works?

package com.app.UI;

import javax.servlet.annotation.WebServlet;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import org.vaadin.addon.JFreeChartWrapper;

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.Title;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

@Theme(“mytheme”)
@Title(“TP_Mon”)

public class TP_Mon extends UI {

@Override
protected void init(VaadinRequest vaadinRequest) {

    VerticalLayout layout = new VerticalLayout(); // Gesamtlayout Haupt

    XYSeries series = new XYSeries("Sprint 1");
    series.add(0, 165);
    series.add(1, 150);
    series.add(2, 130);

    XYSeriesCollection dataset = new XYSeriesCollection();
    dataset.addSeries(series);
    // Generate the graph
    JFreeChart chart = ChartFactory.createXYLineChart("Burn Down Chart", // Title
            "days", // x-axis Label
            "Esimated Effort", // y-axis Label
            dataset, // Dataset
            PlotOrientation.VERTICAL, // Plot Orientation
            true, // Show Legend
            true, // Use tooltips
            false // Configure chart to generate URLs?
    );
    JFreeChartWrapper wrapper = new JFreeChartWrapper(chart) {
        @Override
        public void attach() {
            super.attach();
            markAsDirty();
        }
    };
    layout.addComponent(wrapper);
    setContent(layout);
}

@WebServlet(urlPatterns = "/*", name = "TP_MonServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = TP_Mon.class, productionMode = false, widgetset = "com.app.gwt.AppWidgetSet")
public static class TP_MonServlet extends VaadinServlet {
}

}

News???

Thanks! Works as expected with vaadin
7.6.5
.

Hint
: Do use the second workaround!

thanks a lot.

Hi,

I guess the regression will never be fixed by the core team so I added the workaround to the component in version 3.0.3

cheers,
matti

I have a problem which I’m not sure is it related to this one but lets try.

I have a CssLayout where I have ja table and a JFreeChartWrapper (displaying a pie chart).
Everything is working fine when I’m testing and running the application on Jetty, but on a server (tomcat) I get an Internal Error when displaying the view where the chart is placed. If I use example a label instead of JFreeChartWrapper, everything is OK.

Have anyone else same kind of experience? What can I do to debug the problem, because I don’t get any detailed information ebout the Internal Error?

I’m using latest version from vaadin and jfreechartwrapper.

Sounds quite weird if there is nothing on the server log. If you could share the project creating your war file it might be easier to give some hints to get this resolved.

cheers,
matti

Please help! I am using vaadin client 7.7.3, jfreechartwrapper 3.0.4 and jfreechart 1.0.19 - using the second workaround, nothing appears on the page. Without it, it seems that there is an empty space created for it but no chart appeared. Should I use vaadin 7.6.5?

Thank you!