Menu

Exception Info:$wnd.Highcharts[chartTypeName] is not a constructor

StrongLei
2015-12-03
2015-12-07
  • StrongLei

    StrongLei - 2015-12-03

    Hi,
    I need help,
    Use GWT+Highcharts,very easy sample,but not succ.
    http://www.moxiegroup.com/moxieapps/gwt-highcharts/quickstart.jsp
    email: leiq2010@gmail.com
    env:
    Eclipse IDE for Java Developers
    Version: Luna Release (4.4.0)
    appengine-java-sdk-1.9.28
    gwt-2.7.0
    jdk1.8.0_65
    MyWeb.java
    public void onModuleLoad() {
    Chart chart = new Chart()
    .setType(Series.Type.SPLINE)
    .setChartTitleText("Lawn Tunnels")
    .setMarginRight(10);
    Series series = chart.createSeries()
    .setName("Moles per Yard")
    .setPoints(new Number[] { 163, 203, 276, 408, 547, 729, 628 });
    chart.addSeries(series);
    RootPanel.get("chartContainer").add(chart);
    }
    body
    div id="chartContainer" style="min-width: 800px; height: 500px; margin: 0 2em" /div
    /body

    16:36:40.509 [ERROR] [myweb] Unable to load module entry point class com.stronglei.myweb.client.MyWeb (see associated exception for details)
    com.google.gwt.core.client.JavaScriptException: (TypeError) @org.moxieapps.gwt.highcharts.client.BaseChart::nativeRenderChart(
    Ljava/lang/String;
    Lcom/google/gwt/core/client/JavaScriptObject;
    ZZLcom/google/gwt/core/client/JavaScriptObject;
    Lcom/google/gwt/core/client/JavaScriptObject;
    Lcom/google/gwt/core/client/JavaScriptObject;
    Lcom/google/gwt/core/client/JavaScriptObject;
    Lcom/google/gwt/core/client/JavaScriptObject;
    Lcom/google/gwt/core/client/JavaScriptObject;
    Lcom/google/gwt/core/client/JavaScriptObject;
    Lcom/google/gwt/core/client/JavaScriptObject;
    Lcom/google/gwt/core/client/JavaScriptObject;
    Lcom/google/gwt/core/client/JavaScriptObject;)
    ([string: 'Chart',
    JavaScript object(14),
    bool: false,
    bool: false,
    JavaScript object(41),
    JavaScript object(42),
    JavaScript object(43),
    JavaScript object(33),
    JavaScript object(37),
    JavaScript object(32),
    JavaScript object(35),
    JavaScript object(36),
    JavaScript object(39),
    JavaScript object(40)]
    ):
    $wnd.Highcharts[chartTypeName] is not a constructor
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:252)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:137)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:589)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:293)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at org.moxieapps.gwt.highcharts.client.BaseChart.nativeRenderChart(BaseChart.java)
    at org.moxieapps.gwt.highcharts.client.BaseChart.onLoad(BaseChart.java:2497)
    at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:359)
    at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:484)
    at com.google.gwt.user.client.ui.Panel.adopt(Panel.java:124)
    at com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:105)
    at com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:98)
    at com.stronglei.myweb.client.MyWeb.onModuleLoad(MyWeb.java:49)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:423)
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:530)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:368)
    at java.lang.Thread.run(Unknown Source)

     

    Last edit: StrongLei 2015-12-04
  • StrongLei

    StrongLei - 2015-12-03
     
  • StrongLei

    StrongLei - 2015-12-03

    space is html:
    div id="chartContainer"

     
  • Shawn Quinn

    Shawn Quinn - 2015-12-07

    Sorry for the delay in responding here. This "$wnd.Highcharts[chartTypeName] is not a constructor" message is usually because you don't correctly have either the "highcharts.js" or "highstocks.js" JavaScript file included in your page. See the details in the "Installation Guide" for some additional detail here:

    http://www.moxiegroup.com/moxieapps/gwt-highcharts/userguide.jsp#installation

    Keep us posted if that clears up the problem you're seeing.

     

Log in to post a comment.