vaadin charts trial version after 30 days

Hy!

We’ve downloaded an older version of the vaadin charts approximately half year ago. We had some issues with the highcharts which we were hoping to be solved with the vaadin charts add-on. Unfortunately it had other issues so we returned to the highcharts after a week or so. Recently, we saw that the vaadin charts add-on has been upgraded, so we thought to try it again, whether it is better than what we use lately.
We’ve noticed the licence warning message in the logs (which indicates that our trial licence has been expired?) and the chart that we created has been not displayed. We mostly used the sample codes from the vaadin charts add-on pages, but nothing happened. With debugging it seems like the chart has been built, but it’s never been displayed.

tl;dr
My question is that: Is it possible that after 30days downloading the trial version the add-on just stops working?

Thanks in advance!

Hi Molnar,

Vaadin Chart should not stop working after the license is expired. There have to be some other problem with your setup that broke it. I have couple of specific questions: Could you first try to setup minimum Vaadin project with Vaadin Chart and test will it work there? Which Vaadin version you have in your project?

It would be much easier to see what is going wrong if you could attach the source used or push them into https://github.com/ or somewhere similar.

Br. Johannes

Dear Johannes,

I am taking over the thread from Szilvi (same group).
In principle the code used was working for Charts 1.1.3, but the changes of the surrounding may well be the culprit. Before delving into that however, we took the handiest way by replacing this code with something simple example taken from the Book of Vaadin. This all happens using Vaadin 6.8.13.
Nevertheless now that we learned it should not be the licence we can focus on the code. It will take some time due to other priorities emerged in the meantime. I will report our findings then.

Thank you for your help,
Zsolt

Hi!

Finally after a little digging, we found the origin of the problem.
It was this “Highcharts Error #16” which means that Highcharts already defined in the page.
http://www.highcharts.com/errors/16

Thanks for your help!
Szilvi

Just a little more explanation: the InvienCharts code coexisted with Vaadin Chart in the project and IC started to load its version of highcharts.js causing the above error and preventing Vaadin Chart to work.

Dear Johannes,

After we succsseeded to display a vaadin chart we noticed a bug(?) connecting to the chart’s zooming.
We could reproduce the bug using your chart sample. Would you be so kind to take a look at it, and try it if you have some time. The problem is the following:

There is a vertical layout with a button and a graph in it. The button removes the old graph from the layout and creates a new instance of the chart and adds it to the layout. In the first instance of the graph the zooming is perfectly working. But after we push the button and recreating the chart the zooming doesn’t work. The createChart() method was copied from the vaadin charts demo page, I only added zoomType to the code.
I don’t know what goes wrong…

[code]
package some.package.component;

import com.vaadin.addon.charts.Chart;
import com.vaadin.addon.charts.model.;
import com.vaadin.ui.
;

/**
*
*/
public class GraphWindow extends Window {
private VerticalLayout graphLayout;

public GraphWindow() {
    super("Zooming problem");
    initComponents();
}

private void initComponents() {
    Panel p = new Panel();
    p.setSizeFull();

    graphLayout = createLayout();
    Button button = createGenerateGraphButton();

    VerticalLayout mainLayout = (VerticalLayout) p.getContent();
    mainLayout.addComponent(button);
    mainLayout.addComponent(graphLayout);

    addComponent(p);
}

private Button createGenerateGraphButton() {
    Button b = new Button();
    b.setImmediate(true);
    b.setCaption("Regenerate graph");
    b.addListener(createListener());

    return b;
}

private Button.ClickListener createListener() {
    return new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            graphLayout.removeAllComponents();

            VerticalLayout vl = createLayout();
            graphLayout.addComponent(vl);
        }
    };
}

private VerticalLayout createLayout() {
    Chart chart = createChart();

    VerticalLayout vl = new VerticalLayout();
    vl.setSizeFull();
    vl.setSpacing(true);

    vl.addComponent(chart);

    return vl;
}

private Chart createChart() {
    Chart chart = new Chart();
    chart.setHeight("450px");
    chart.setWidth("100%");

    Configuration configuration = new Configuration();
    configuration.getChart().setType(ChartType.LINE);
    configuration.getChart().setMarginRight(130);
    configuration.getChart().setMarginBottom(25);

    configuration.getTitle().setText("Monthly Average Temperature");
    configuration.getSubTitle().setText("Source: WorldClimate.com");

    configuration.getxAxis().setCategories("Jan", "Feb", "Mar", "Apr",
            "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");

    Axis yAxis = configuration.getyAxis();
    yAxis.setMin(-5d);
    yAxis.setTitle(new Title("Temperature (°C)"));
    yAxis.getTitle().setVerticalAlign(VerticalAlign.HIGH);

    configuration
            .getTooltip()
            .setFormatter(
                    "''+ this.series.name + '' + this.x +': '+ this.y +'°C'");

    PlotOptionsLine plotOptions = new PlotOptionsLine();
    plotOptions.setDataLabels(new Labels(true));
    configuration.setPlotOptions(plotOptions);

    Legend legend = configuration.getLegend();
    legend.setLayout(LayoutDirection.VERTICAL);
    legend.setHorizontalAlign(HorizontalAlign.RIGHT);
    legend.setVerticalAlign(VerticalAlign.TOP);
    legend.setX(-10d);
    legend.setY(100d);
    legend.setBorderWidth(0);

    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);
    ls = new ListSeries();
    ls.setName("New York");
    ls.setData(-0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1,
            8.6, 2.5);
    configuration.addSeries(ls);
    ls = new ListSeries();
    ls.setName("Berlin");
    ls.setData(-0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9,
            1.0);
    configuration.addSeries(ls);
    ls = new ListSeries();
    ls.setName("London");
    ls.setData(3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6,
            4.8);
    configuration.addSeries(ls);

    configuration.getChart().setZoomType(ZoomType.XY);

    chart.drawChart(configuration);
    return chart;
}

}
[/code]Thanks in advance!
Szilvi

Hi,

I was able to reproduce the issue. I will investigate it more as soon as possible…

Johannes

Yes, it seem to be a bug in Charts. It seem to work all right in Vaadin 7.2.

For Vaadin 6.8.15, I was able to find a workaround. It works if all window content is removed and regenerated in the button click, and not just graphlayout.

I suggest you to make a bug report of this in http://dev.vaadin.com/

Johannes

Just a correction of mixing another topic into the original thread. It belongs to:
https://vaadin.com/forum#!/thread/8192188

Dear Johannes,

I know it’s been a while since we discussed this topic, but if you be so kind to help a little more I’d be more than pleased. Only now I’ve got the time to change our charts from invient to vaadin charts. I tried your workaround but somehow I can’t make it work.

I tried the following but still not working…

[code]
private Button.ClickListener createListener() {
return new Button.ClickListener() {
@Override
public void buttonClick(Button.ClickEvent event) {
// removeAllComponents();
// initComponents();

         //  getContent().removeAllComponents();
         //  initComponents();
         
        getWindow().getContent().removeAllComponents();
        initComponents();
    }
 };

}
[/code]What else (or how?) should I remove to achive the correct zooming?

Thanks for your help.
Szilvi