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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:55:22+00:00 2026-06-17T19:55:22+00:00

I’m trying to create a Dashboard with column chart and a few category filters

  • 0

I’m trying to create a Dashboard with column chart and a few category filters in my app, I have data like this :

['First name', 'City', 'Number of children'],
['Michael' , 'London', 2],
['Elisa', 'Paris', 3],
['Robert', 'Moskov', 3],
['John','LA', 1],
['Jessica', 'Kyiv', 3],
['Aaron', 'New York', 2],
['Margareth','Tokyo', 3 ]

but I have to visualize not this data, but a table with total amount of people with same number of children:

[‘1 child’, ‘2 children’, ‘3 children’],

[1, 2 , 4]

So when I apply some filter to first table than data in second table must be re-calculated automatically. Can I somehow bind this tables and controls together ? Or I have to put some handlers for each filter and re-calculate data manually ?

  • 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-17T19:55:24+00:00Added an answer on June 17, 2026 at 7:55 pm

    I assume that given your data:

    ['First name', 'City', 'Number of children'],
    ['Michael' , 'London', 2],
    ['Elisa', 'Paris', 3],
    ['Robert', 'Moskov', 3],
    ['John','LA', 1],
    ['Jessica', 'Kyiv', 3],
    ['Aaron', 'New York', 2],
    ['Margareth','Tokyo', 3 ]
    

    You want to group by your 2nd column (number of children) to get this result:

    [1, 1],
    [2, 2],
    [3, 4]
    

    You can do this easily using the group by aggregation feature for data tables.

    Here is sample code:

    function drawJoin() {
      var dt = google.visualization.arrayToDataTable([
        ['First name', 'City', 'Number of children'],
        ['Michael' , 'London', 2],
        ['Elisa', 'Paris', 3],
        ['Robert', 'Moskov', 3],
        ['John','LA', 1],
        ['Jessica', 'Kyiv', 3],
        ['Aaron', 'New York', 2],
        ['Margareth','Tokyo', 3 ]
      ]);
    
      // Group dt by column 2, and count number of entries for each.
      var grouped_dt = google.visualization.data.group(
          dt, [2],
          [{'column': 0, 'aggregation': google.visualization.data.count, 'type': 'number'}]);
    
    
      var table = new google.visualization.Table(document.getElementById('table'));
      table.draw(dt, null);
    
      var grouped_table = new google.visualization.Table(document.getElementById('grouped_table'));
      grouped_table.draw(grouped_dt, null);
    }
    

    Feel free to try it out on Google Playground (just copy-paste the above code in).

    You can graph that as is, or you can transpose it using a javascript function to transcribe rows/columns in your datatable.

    So you should filter using your controls on the original data table, and then create a grouping function, and draw the grouped table in your chart.

    If you want the labels to read ‘1 child’ instead of just the number 1, then you need to create a function using SetFormattedValue() since the output of the group would be a number. You could mix this with the transpose function above since you’re already doing work on the data table.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.