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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:06:40+00:00 2026-05-29T04:06:40+00:00

I have two python lists passlist1= [[1, Saturday], [6, Sunday], [12 ,Wednesday], [31, Monday],

  • 0

I have two python lists

passlist1= [[1, "Saturday"], [6, "Sunday"], [12 ,"Wednesday"], [31, "Monday"], [14, "Monday"], [1, "Tuesday"], [1, "Sunday"]]
failedlist2= [[11, "Saturday"], [26, "Sunday"], [22 ,"Wednesday"], [41, "Monday"], [15, "Monday"], [16, "Tuesday"], [51, "Sunday"]]

I can plot the graph using single list by just passing list1 as a parameter
but now i want to plot both lists in a single graph.
This is my chart code

//load the Google Visualization API and the chart
google.load('visualization', '1', {'packages': ['columnchart']});

//set callback
google.setOnLoadCallback (createChart);

//callback function
function createChart() {

    //create data table object
    var dataTable = new google.visualization.DataTable();
    dataTable.addColumn('string','Number Stats');
    dataTable.addColumn('number', passeD');
    dataTable.addColumn('string', Failed');

    dataTable.addRows(list1);

    //instantiate our chart object
    var chart = new google.visualization.ColumnChart (document.getElementById('chart'));


    //define options for visualization  
    var options = {width: 400, height: 240, is3D: true, title: 'Bar Chart'};

    //draw our chart
    chart.draw(dataTable, options);

}

I need something like a comparison chart of passlist and failedlist.

Is it possible?

  • 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-29T04:06:41+00:00Added an answer on May 29, 2026 at 4:06 am

    Instead of adding all rows at once you can use addRow method to combine multiple arrays into one row.

    <html>
      <head>
        <!--Load the AJAX API-->
        <script type="text/javascript" src="https://www.google.com/jsapi"></script>
        <script type="text/javascript">
    
    var  list1= [[1, "Saturday"], [6, "Sunday"], [12 ,"Wednesday"], [31, "Monday"], [14, "Monday"], [1, "Tuesday"], [1, "Sunday"]]
    var list2= [[11, "Saturday"], [26, "Sunday"], [22 ,"Wednesday"], [41, "Monday"], [15, "Monday"], [16, "Tuesday"], [51, "Sunday"]]
    
    //load the Google Visualization API and the chart
    google.load('visualization', '1', {'packages': ['columnchart']});
    
    //set callback
    google.setOnLoadCallback (createChart);
    
    //callback function
    function createChart() {
    
        //create data table object
        var dataTable = new google.visualization.DataTable();
        dataTable.addColumn('string','Number Stats');
        dataTable.addColumn('number', 'passed');
        dataTable.addColumn('number', 'failed');
    
        for(var i = 0; i < list1.length; i++){
            var row =  [ list1[i][1], list1[i][0], list2[i][0] ];
            dataTable.addRow( row );
        }
    
        //instantiate our chart object
        var chart = new google.visualization.ColumnChart (document.getElementById('chart'));
    
    
        //define options for visualization  
        var options = {width: 400, height: 240, is3D: true, title: 'Bar Chart'};
    
        //draw our chart
        chart.draw(dataTable, options);
    
    }
        </script>
      </head>
    
      <body>
        <!--Div that will hold the pie chart-->
        <div id="chart"></div>
      </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Python, compute list difference I have two lists For example: A =
I am using sqlite3 in python. I have two tables with id column in
I'm using Python with Matplotlib for drawing. I have two matrices (images in levels
I have two lists in python and I want to know if they intersect
I have two strings in python that I have converted to lists: Seq1 =
Working in python 2.7. I have two lists (simplified to make explanation more clear):
Working in python 2.7. I have two lists (simplified to make explanations clearer). T
Working in Python 2.7. I have two different lists, A and B (simplified to
I want to do this. I have two python lists, one larger than the
I have the two lists in Python list_1 = [5, 2, 8]; list_2 =

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.