Vaadin Charts not neing portrayed

Dear all,

I’m trying to use Vaadin Charts on a legacy Vaadin application (6.8.12) developed on NetBeans. I have followed the instructions in
this tutorial
and the both the widgetset and the overall project compile without problems. Unfortunatelly, no chart objects are portrayed in the web pages at run time; this example, for instance, does not show a thing:

protected Component getChart() {
        Chart chart = new Chart(ChartType.BAR);

        Configuration conf = chart.getConfiguration();

        conf.setTitle("Historic World Population by Region");

        XAxis x = new XAxis();
        x.setCategories("Africa", "America", "Asia", "Europe", "Oceania");
        x.setTitle((String) null);

        YAxis y = new YAxis();
        Title title = new Title("Population (millions)");

        Tooltip tooltip = new Tooltip();
        tooltip.setFormatter(" +': '+ this.y +' millions'");

        PlotOptionsBar plot = new PlotOptionsBar();
        plot.setDataLabels(new Labels(true));


        List series = new ArrayList();
        series.add(new ListSeries(107, 31, 635, 203, 2));


        return chart;

So far the only strange thing I found is this message in the debug window regarding HighCharts:

JavaScriptException: (String): Highcharts error #16:
Processing time was 140ms for 7645 characters of JSON
Referenced paintables: 34

I’ve searched for similar errors but haven’t found anything yet.

Any hints on what may be going wrong would be helpful. Thank you.

Looking at the
error description
, somehow the HighCharts is loaded twice. Just putting two charts in the same page doesn’t cause that, so I don’t know what could cause the situation. Are you embedding the Vaadin app in a page? Running in a portal?

Hi Marko, thank you for the reply. This is just a web page, a panel, some layouts, labels and a chart, just to test it.

Is there anything else I could post to detail the problem?

Thank you.

I think his question was more aimed towards whether you are accessing the Vaadin application directly from the server (server:port/yourapp), if it is embedded in a html page (as described
) or if you use some type of portal service (like for example liferay).

What sounds a bit weird to me is the part with “both the widgetsets” in regards to “HighCharts is loaded twice” what Marko said but i’m neither a Charts,Highcharts nor a Netbeans expert (Not really using any of them).

Yes, that’s the way I am acessing it. The web page is not embedded.

[quote=Marius ReinwaldWhat sounds a bit weird to me is the part with “both the widgetsets” in regards to “HighCharts is loaded twice” what Marko said but i’m neither a Charts,Highcharts nor a Netbeans expert (Not really using any of them).

There is only one widgetset in the project, and I don’t think there should be more than one. But I’m no expert on Vaadin either :slight_smile:

It’s hard to say what could be wrong. I don’t think it should be a NetBeans problem as such, except maybe there’s something odd in the project, like it doesn’t actually use the compiled widget set? Check the request log (with Firebug or some other tool) and see that the correct widget set and other things are loaded correctly.

Following Marko’s sugestion I went checking the http requests made by the app. There are only two that seem relevant, the widgetset and the Highcharts.js:



And here’s the contents of the Script tab:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">html, body {height:100%;margin:0;}</style><link rel="shortcut icon" type="image/" href="/MyApp/VAADIN/themes/MyApp/favicon.ico" /><link rel="icon" type="image/" href="/MyApp/VAADIN/themes/MyApp/favicon.ico" /><title>MyApp&#32;&#45;&#32;Bienvenue&#32;dans&#32;l&#39;outil&#32;&#34;MyApp&#34;</title>
<body scroll="auto" class="v-generated-body">
<script type="text/javascript">
document.write("<script language='javascript' src='./jquery/jquery-1.4.4.min.js'><\/script>");
document.write("<script language='javascript' src='./js/highcharts.js'><\/script>");
document.write("<script language='javascript' src='./js/modules/exporting.js'><\/script>");
<script type="text/javascript">
if(!vaadin || !vaadin.vaadinConfigurations) {
if(!vaadin) { var vaadin = {}}
vaadin.vaadinConfigurations = {};
if (!vaadin.themesLoaded) { vaadin.themesLoaded = {}; }
vaadin.debug = true;
 = {appUri:'/MyApp/App', standalone: true, themeUri:"/MyApp/VAADIN/themes/MyApp", versionInfo : {vaadinVersion:"6.8.12",applicationVersion:"NONVERSIONED"},"comErrMsg": {"caption":"Communication problem","message" : "Take note of any unsaved data, and <u>click here<\/u> to continue.","url" : null},"authErrMsg": {"caption":"Authentication problem","message" : "Take note of any unsaved data, and <u>click here<\/u> to continue.","url" : null}};
<iframe tabIndex='-1' id='__gwt_historyFrame' style='position:absolute;width:0;height:0;border:0;overflow:hidden;' src='javascript:false'></iframe>
<script language='javascript' src='/MyApp/VAADIN/widgetsets/com.crte.MyApp.widgetset.MyAppWidgetSet/com.crte.MyApp.widgetset.MyAppWidgetSet.nocache.js?1379508015036'></script>
<script type="text/javascript">
) {
var stylesheet = document.createElement('link');
stylesheet.setAttribute('rel', 'stylesheet');
stylesheet.setAttribute('type', 'text/css');
stylesheet.setAttribute('href', '/MyApp/VAADIN/themes/MyApp/styles.css');
 = true;
<script type="text/javascript">
setTimeout('if (typeof com_crte_MyApp_widgetset_MyAppWidgetSet == "undefined") {alert("Failed to load the widgetset: /MyApp/VAADIN/widgetsets/com.crte.MyApp.widgetset.MyAppWidgetSet/com.crte.MyApp.widgetset.MyAppWidgetSet.nocache.js?1379508015036")};',15000);
<div id="MyAppApp-1839652626" class="v-app v-theme-MyApp v-app-MyApp" ><div class="v-app-loading"></div></div>
<noscript>You have to enable javascript in your browser to use an application built with Vaadin.</noscript></body>

I don’t see anything strange here…

Thanks for helping.

Why does the page include loader code for HighCharts? The Vaadin servlet does not normally add those and as far as I know, Charts loads HighCharts dynamically in the widget set. Are you maybe also using Invient Charts, which also uses HighCharts?

Hi again Marko. This project used Invient Charts at some point in the past, but it is no longer included in the library path, nor in the widgetset. But this could indeed explain the problems I’m having. I can’t find any references in the code to Invient Charts, but I don’t know exactly all the places I should look into.

Thank you for helping.

I don’t know about Invient Charts installation, but it might require that the extra headers to load HighCharts are written in the Vaadin servlet or something.

Thank you very much Marko, that was exactly the case. There was this line in the file:

page.write("document.write(\"<script language='javascript' src='./js/highcharts.js'><\\/script>\");\n");

Once I removed it the charts started appearing. This bit of code was probably already there when I started working on the project.

Thanks to all for the replies.