Andreas11
(Andreas Lüdtke)
January 29, 2015, 2:09pm
2
Hi Gerard,
I’m currently migrating a Vaadin 6.8 application to Vaadin 7.3 and have the same problem! I also made a little test project to nail the problem down, but even with this little application, I don’t see a chart!
Have you solved this problem in the mean time?
Best regards
Andreas
Andreas11
(Andreas Lüdtke)
January 29, 2015, 2:41pm
3
Just another info: I used the test code from the addon (JFreeChartWithVaadin.java) and made a tiny project with Vaadin 7.3.9, jfreechart 1.0.14 and jfreechartwrapper 3.0.2:
Still the same: program compiles and runs with out errors or warning in log but the browser doesn’t show me a chart! I can see the JavaScript Progress indicator advancing but afterwards it’s still all blank.
Does anybody use this addon together with Vaadin 7.3.9?
David280
(David Kennedy)
February 6, 2015, 8:06am
4
Looks like the addon (with jfreechartwrapper revision 3.0.2 and jfreechart 1.0.13) broke in Vaadin 7.3.9 - went back through a load of versions and 7.3.8 is the latest that seems fine. Also went forward and alas is still broken in 7.3.10 as well as 7.4.0.beta3
Andreas11
(Andreas Lüdtke)
February 6, 2015, 9:09am
5
David,
thanks for your effort. I hope that the addon maintainer is reading this too…
I opened an issue here:
https://code.google.com/p/jfreechart-wrapper-for-vaadin/issues/detail?id=6
Matti
(Matti Tahvonen)
February 6, 2015, 1:48pm
6
Hi, there indeed seems to be a regression with 7.3.X series. I’ll see if I can make a workaround for this.
Jose36
(Jose Lopez)
February 6, 2015, 1:48pm
7
We had the same problem with 7.3.10. With 7.3.8 it works fine.
Andreas11
(Andreas Lüdtke)
February 6, 2015, 1:51pm
8
Thanks Matti and have a nice weekend
Matti
(Matti Tahvonen)
February 6, 2015, 1:52pm
9
Thanks, this may help, sounds like a brand new regression
Matti
(Matti Tahvonen)
February 6, 2015, 2:14pm
10
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();
}
};
Andreas11
(Andreas Lüdtke)
February 9, 2015, 8:50am
11
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.
Matti
(Matti Tahvonen)
February 9, 2015, 12:22pm
12
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());
}
};
Andreas11
(Andreas Lüdtke)
February 9, 2015, 12:33pm
13
Great!
Now it works with Vaadin 7.3.10.
Thanks again
Giovanni
(Giovanni Adobati)
February 10, 2015, 3:02pm
14
Perfect solution also for me. !!
Thanks
Erwin10
(Erwin Lin)
April 14, 2015, 9:02am
16
Work like charmed…
Thank you…
Thorsten38
(Thorsten Pottiez)
December 20, 2015, 4:26pm
18
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 {
}
}
Thanks! Works as expected with vaadin
7.6.5
.
Hint
: Do use the second workaround!