A problem with the zoom of a chart

Hello Vaadin-Community,

unfortunately I have a problem with the Vaadin (v7.6.6) charts. I use two charts. The frist chart is a component of a VerticalLayout and the other one is embedded in a window. But when I close the window, the zoom of the first chart does not work any more.

My code looks like:

[code]
Chart myLayoutChart = new Chart();
DataSeries series = new DataSeries();
… // fill the data series
myLayoutChart.getConfiguration().setSeries(series);
myLayoutChart.getConfiguration().getChart().setZoomType(ZoomType.XY);

verticalLayout.addComponent(myLayoutChart);
Chart myWindowChart = new Chart();

Window myWindow = new Window(“”, myWindowChart);
getUI().addWindow(myWindow);
[/code]Can anyone help me with my issue?

Cheers!

Hi Till,

Unluckily I don’t have much time to reproduce it right now, but could you mention if it happens with all browsers or only in some specific browser, and if there’s any error in the browser js console? Also, does it happen just by closing a window that doesn’t contain a Chart?

Cheers,

Guille

Hey Guillermo,

thank you for your answer. It happens in the Firefox, GoogleChrome and IE browser. So I think it is not a browser specific problem. There is no error in the js console and it does not happen if the window does not contain a Chart.

But maybe you have a tip how I solve my main purpose. I want to create a fullscreen of a Chart when double-clicking on it. So that you can take a better look on it. May you have an alternative solution for that?

Thank you for your precious time! :slight_smile:

Till

Hi again,

I think your approach is ok, the only thing I’m not sure is possible is the double click event for chart.

I did this small/quick test:

    private Chart getChartWithZoomAndPopup() {
        Chart mainChart = new Chart();
        Configuration configuration = mainChart.getConfiguration();
        configuration.getChart().setZoomType(ZoomType.XY);
        ListSeries ls = new ListSeries();
        ls.setName("Tokyo");
        ls.setData(7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6);
        configuration.addSeries(ls);

        mainChart.addChartClickListener(new ChartClickListener() {
            @Override
            public void onClick(ChartClickEvent event) {
                if (event.isMetaKey()) {
                    Chart windowChart = new Chart();
                    Configuration configuration = windowChart.getConfiguration();
                    ListSeries ls = new ListSeries();
                    ls.setName("Tokyo W");
                    ls.setData(7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6);
                    configuration.addSeries(ls);

                    Window myWindow = new Window("", windowChart);
                    myWindow.setSizeFull();
                    getUI().addWindow(myWindow);
                }
            }
        });

        return mainChart;
    }

And have no issues with zoom after closing the window. Tested with 7.6.6 and both Vaadin Charts 2.1.3 and 3.0.0.

Is there any big difference with your implementation?