Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4101632
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:43:20+00:00 2026-05-20T20:43:20+00:00

I’m currently building a SmartGWT-based web application (using the Portlet Layout). So I have

  • 0

I’m currently building a SmartGWT-based web application (using the Portlet Layout). So I have several “Portlet”, which basically extend GWT Window with different content. Now I want a Portlet to display Dygraphs. So I’ve created an RPC Service implementation which returns a JSON String (based on a DataTable object).

Since I cannot directly serialize a DataTable object I use

String json = JsonRenderer.renderDataTable(data, true, true).toString();

where “data” is of type DataTable.

Now this String gets correctly passed to the client side where I want to create the Dygraph. In this thread , someone suggested to use

public static native DataTable toDataTable(String json) 
/-{ return new $wnd.google.visualization.DataTable(eval("(" + json + ")")); }-/;

If I use this in my GWT client code, i get an error saying

com.google.gwt.core.client.JavaScriptException: (TypeError): $wnd.google.visualization is undefined

Do i miss some “import” of the visualization API? Where do i have to instantiate it?

Or is there another way to get the JSON datastring into the Dygraph? I can’t find any examples…

Thank you for any hint!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T20:43:21+00:00Added an answer on May 20, 2026 at 8:43 pm

    I assume you have included the visualization.jar and the visualization namespace in your module’s XML

    <inherits name="com.google.gwt.visualization.Visualization"/>
    

    This will give you the Classes. You probably have done this otherwise you would have gotten a compiler error.

    However you also have to include the actual visualization javascript file from the google servers (the visualization.jar is only a wrapper). This can be done in two different ways:

    1.) Include it in the host page:

    <script type="text/javascript">
            google.load("visualization", "1", {'packages' : ["corechart"] });
    </script>
    

    or

    2.) Load it dynamically where you need it:

    VisualizationUtils.loadVisualizationApi(onLoadCallback, MotionChart.PACKAGE);
    

    see http://code.google.com/docreader/#p=gwt-google-apis&s=gwt-google-apis&t=VisualizationGettingStarted

    Btw. I have forked the Dygraphs Project and changed the GWT wrapper to more like the other visualization wrappers. You can check it out here: https://github.com/timeu/dygraphs

    Edit: I have a new GWT wrapper for dygraphs that uses the GWT 2.8’s new JsInterop: https://github.com/timeu/dygraphs-gwt

    Note: I changed some behaviour in dygraphs and added some features which weren’t available in the upstream code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.