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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:12:42+00:00 2026-06-17T08:12:42+00:00

[ { Description: Accommodation, ChartData: [ { label: Acceptable, data: 24 }, { label:

  • 0
[
{
    "Description": "Accommodation",
    "ChartData": [
        {
            "label": "Acceptable",
            "data": 24
        },
        {
            "label": "Excellent",
            "data": 30
        },
        {
            "label": "Good",
            "data": 96
        },
        {
            "label": "Poor",
            "data": 2
        }
    ]
},    
{
    "Description": "Food and Beverage",
    "ChartData": [
        {
            "label": "Acceptable",
            "data": 44
        },
        {
            "label": "Excellent",
            "data": 24
        },
        {
            "label": "Good",
            "data": 94
        },
        {
            "label": "Poor",
            "data": 13
        }
    ]
},
{
    "Description": "Meeting Space",
    "ChartData": [
        {
            "label": "Acceptable",
            "data": 30
        },
        {
            "label": "Below Expectations",
            "data": 2
        },
        {
            "label": "Exceeds Expectations",
            "data": 3
        },
        {
            "label": "Excellent",
            "data": 54
        },
        {
            "label": "Good",
            "data": 111
        },
        {
            "label": "Meets Expectations",
            "data": 7
        },
        {
            "label": "Poor",
            "data": 6
        }
    ]
},    
{
    "Description": "Service",
    "ChartData": [
        {
            "label": "Acceptable",
            "data": 25
        },
        {
            "label": "Exceeds Expectations",
            "data": 3
        },
        {
            "label": "Excellent",
            "data": 46
        },
        {
            "label": "Good",
            "data": 111
        },
        {
            "label": "Meets Expectations",
            "data": 8
        },
        {
            "label": "Poor",
            "data": 11
        }
    ]
},
{
    "Description": "Standard of Decor",
    "ChartData": [
        {
            "label": "Acceptable",
            "data": 38
        },
        {
            "label": "Excellent",
            "data": 34
        },
        {
            "label": "Good",
            "data": 126
        },
        {
            "label": "Poor",
            "data": 5
        }
    ]
}
]

Using the above JSON, how do I loop through each and assign two variables containing the description, and the array for ChartData in jquery/javascript i.e.

foreach() {
var Description = data[].Description;
var ArrayOfChartData = data[].ChartData;
}

I’ve tried using an .each loop but can’t return the correct data.

  • 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-17T08:12:43+00:00Added an answer on June 17, 2026 at 8:12 am

    JavaScript arrays have a forEach method:

    data.forEach(function (v) {
        var Description = v.Description;
        var ArrayOfChartData = v.ChartData;
        // now use that...
    });
    

    Here’s the fiddle: http://jsfiddle.net/u7RuZ/


    Unfortunately, IE < 9 does not support this. If you have to support IE8, you can use jQuery’s $.each:

    $.each(data, function (i, v) {
        var Description = v.Description;
        var ArrayOfChartData = v.ChartData;
        // now use that...
    });
    

    Here’s the fiddle: http://jsfiddle.net/u7RuZ/1/

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

Sidebar

Related Questions

Description My solution has these projects: DAL = Modified Entity Framework DTO = Data
Description: the query actually run have 4 results returned,as can be see from below,
Description: Somewhere below BODY is a DIV, say <div id=keepme></div> , that should be
Description: The code below is the simplest code I could write which causes the
Description: Based on other Similar issues listed below, it seems I would have a
description_id description -------------- ------------- 1 Ampicillin Oral 1 Ofloxacin Oral 1 Sulfamoxole+Trimethoprim Oral 2
Description: If we use java objects jruby get permgen too: System.out.println(Initialazing..); //Spring applicaton context
Description : I am creating customized title bar. The codes for customization is as
Description: An unhandled exception occurred during the execution of the current web request. Please
Description: I have a problem regarding DataGridView . I need to show a Client_Name

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.