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 6175859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:59:50+00:00 2026-05-23T23:59:50+00:00

Is there a way to use the Google Chart Javascript API to center bars

  • 0

Is there a way to use the Google Chart Javascript API to center bars on a bar chart similar to this – Google Chart Example? I would like to emulate a funnel graph wih Google Charts. Google Charts does not support a funnel type of graph.

enter image description here

  • 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-23T23:59:50+00:00Added an answer on May 23, 2026 at 11:59 pm

    Yes that’s possible. Basically what they’re doing in this example is creating a basic bar chart (http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html). To get this ‘funnel’ effect, they create a stacked chart (in javascript see the isStacked property). The first element they color white and the next element in this example is orange.

    You can see this for yourself by changing the color property: chco=ffffff,FF9900 to for instance chco=aaaaaa,FF9900.

    http://chart.apis.google.com/chart?cht=bhs&chco=aaaaaa,FF9900&chxt=x,x,y&chxl=1:|Percentage%20converting|2:|Step%206|Step%205|Step%204|Step%203|Step%202|Step%201&chxp=1,50|3,50&chd=t:0,12.5,28,29,35.5,48.5|100,75,44,42,29,3&chbh=a&chs=800×230&chm=N**%,000000,1,-1,11,,c&chds=0,100

    Then you’ll see that it’s a basic stacked chart, and not really a new kind of graph.

    The following code shows how to do this:

        function drawVisualization() {
      // Create and populate the data table.
      var data = new google.visualization.DataTable();
      var raw_data = [['Invisible', 10, 20, 30, 40],
                      ['Visible', 80, 60, 40, 20]];
    
      var years = ["Step1", "Step2", "Step3", "Step4"];
    
      data.addColumn('string', 'Year');
      for (var i = 0; i  < raw_data.length; ++i) {
        data.addColumn('number', raw_data[i][0]);    
      }
    
      data.addRows(years.length);
    
      for (var j = 0; j < years.length; ++j) {    
        data.setValue(j, 0, years[j].toString());    
      }
      for (var i = 0; i  < raw_data.length; ++i) {
        for (var j = 1; j  < raw_data[i].length; ++j) {
          data.setValue(j-1, i+1, raw_data[i][j]);    
        }
      }
    
      // Create and draw the visualization.
      new google.visualization.BarChart(document.getElementById('visualization')).
          draw(data,
               {title:"Yearly Coffee Consumption by Country",
                width:600, height:400,
                colors: ['ffffff','aaaaaa'], 
                vAxis: {title: "Year"},
                hAxis: {title: "Cups", gridlineColor : 'ffffff'}, isStacked: true}
          );
    }
    

    ​

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

Sidebar

Related Questions

Is there a way to use the Google Translate API with PHP (server-side)?
I see this link to use google chart api for putting multiple line charts
Is there any way to use a constant as a hash key? For example:
Is there a way to use constants in JavaScript ? If not, what's the
Is there a way to use maps.google.com's get direction's functionality so that I can
Is there an easy way to use the google maps searchbar to only recieve
I would like to use Google Analytics but I am concerned about adding more
HI all, i'm trying to use google chart API to make some charts in
Is there a way to use Google Chrome (or Safari or Firefox) as the
In the old Google Chart API it was possible to use PHP to render

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.