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

  • SEARCH
  • Home
  • 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 8577083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:04:56+00:00 2026-06-11T20:04:56+00:00

i am making my first chart in google visualization , trying to make a

  • 0

i am making my first chart in google visualization ,
trying to make a simple bar chart

I got this from the example :

        VerticalPanel vp = new VerticalPanel();
        Options options = Options.create();
        options.setHeight(240);
        options.setTitle("Company Performance");
        options.setWidth(400);
        options.set3D(true);

        DataTable data = DataTable.create();
        data.addColumn(ColumnType.STRING, "Year");
        data.addColumn(ColumnType.NUMBER, "Sales");
        data.addColumn(ColumnType.NUMBER, "Expenses");
        data.addRows(4);
        data.setValue(0, 0, "2004");


        VisualizationWidget<BarChart, BarChart.Options> widget = 
          BarChart.createWidget(data, options);
        BarChart viz = widget.getVisualization();
        Label status = new Label();
        viz.addSelectHandler(new SelectionDemo(viz, status));
        vp.add(status);
        vp.add(widget);

this line

                  VisualizationWidget<BarChart, BarChart.Options> widget = 
          BarChart.createWidget(data, options);

says

               VisualizationWidget cannot be resolved to a type

compilation error :

    [ERROR] Line 150:  VisualizationWidget cannot be resolved to a type
  [ERROR] Line 151:  The method createWidget(DataTable, PieChart.Options) is undefined for the type BarChart
  [ERROR] Line 154:  SelectionDemo cannot be resolved to a type

i’m not able to understand whats this VisualizationWidget, if you could guide me how to resolve this

Thanks

  • 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-06-11T20:04:57+00:00Added an answer on June 11, 2026 at 8:04 pm

    It shows that you might forget to add a dependency of Visualization jar in your project.
    you could try to add the dependency by hand to the .gwt.xml file in your project:

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

    Add below code in your .html file:

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

    Code

    @Override
        public void onModuleLoad() {
    
    
              VerticalPanel vp = new VerticalPanel();
                final Options options = Options.create();
                options.setHeight(240);
                options.setTitle("Company Performance");
                options.setWidth(400);
                options.set3D(true);
    
                 DataTable data = DataTable.create();
                data.addColumn(ColumnType.STRING, "Year");
                data.addColumn(ColumnType.NUMBER, "Sales");
                data.addColumn(ColumnType.NUMBER, "Expenses");
                data.addRows(4);
                data.setValue(0, 0, "2004");
    
                BarChart barChart=new BarChart(data, options);
    
                vp.add(barChart);
                RootPanel.get().add(vp);
    
    
                Runnable onLoadCallback = new Runnable() {
                    public void run() {
                      Panel panel = RootPanel.get();
    
                      // Create a pie chart visualization.
                      BarChart pie = new BarChart(createTable(), options);
                      panel.add(pie);
                    }
                  };
    
    
                  VisualizationUtils.loadVisualizationApi(onLoadCallback, BarChart.PACKAGE);
    
        }
          private AbstractDataTable createTable() {
                DataTable data = DataTable.create();
                data.addColumn(ColumnType.STRING, "Task");
                data.addColumn(ColumnType.NUMBER, "Hours per Day");
                data.addRows(2);
                data.setValue(0, 0, "Work");
                data.setValue(0, 1, 14);
                data.setValue(1, 0, "Sleep");
                data.setValue(1, 1, 10);
                return data;
              }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making my first iphone application and it's a wine chart application. It's with
Making my first steps in RIA Services (VS2010Beta2) and i encountered this problem: created
I am making a bar chart and I want two separate gradients for each
I'm making my first attempt at experimenting with Comet. I developed a very simple
I am just starting out making my first website. What I am trying to
This is my first attempt on semaphores and threads. I constructed this code from
im making a simple TCP client-server in c and im trying to send a
This is my first real crack at making a database in Third Normal Form.
I am making my first android app. I want to save an array of
I am making my first android application, and it requires switching between activities very

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.