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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:39:42+00:00 2026-05-30T10:39:42+00:00

I am trying to create Jqplot bar charts and facing difficulty in creating multidimensional

  • 0

I am trying to create Jqplot bar charts and facing difficulty in creating multidimensional array in like

   var plot2 = $.jqplot('chart2', [
    [[2,1], [4,2], [6,3], [3,4]], 
    [[5,1], [1,2], [3,3], [4,4]], 
    [[4,1], [7,2], [1,3], [2,4]]],

My data is in a HashMap inside hashMap it is like

 {software={low=1,high=5, medium=4}, harware={low=3,high=3},network{low=3,high=3,medium=8}}

How I can interpret my data in above multidimensional array.

I have written the following code to achieve this

 $(document).ready(function(){  
    <c:forEach var="data" varStatus="main" items="${data}">  

    var cdata = new Array();

    var twoDOuterArray = new Array(${data.size()});

    <c:forEach var="mapEntry" varStatus="status" items="${data['cData']}">
        twoDOuterArray[${status.index}] = new Array(3);
    </c:forEach>

    <c:forEach var="mapEntry" varStatus="status" items="${data['cData']}">
    <c:forEach var="dataValue" varStatus="status2" items="${mapEntry.value}">
        var valueArray = new Array();           
        alueArray.push(${dataValue.value});
        valueArray.push("${mapEntry.key}");
        twoDOuterArray[${status2.index}][${status.index}]=valueArray;
    </c:forEach>
    //alert(twoDOuterArray[${status.index}].length);
    </c:forEach>



    data.push(twoDOuterArray);

    alert(twoDOuterArray);

    plot2b = $.jqplot('chart2', data, {
        seriesDefaults: {
            renderer:$.jqplot.BarRenderer,
            pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
            shadowAngle: 50,
            rendererOptions: {
                barDirection: 'horizontal'
            }
        },
        title:{
            text: "${title}",                    
            show: true,               
            textColor:"#fff",
        },
        axes: {
            yaxis: {
                renderer: $.jqplot.CategoryAxisRenderer
            }
        },
        legend: { show:true, location: 'e' }
    });


    );

</c:forEach>
});

It seems that format is correct but I don’t understand where I am wrong or is this the correct way to create data. if anyone could help me to solve this that would be great.

edit:
how I can check that my array is created in the above required format?

  • 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-30T10:39:44+00:00Added an answer on May 30, 2026 at 10:39 am

    To see what your data looks like, I’d use Firebug (or your favorite browser’s equivalent) to set a breakpoint on the call to jqplot. Then inspect the variable you want to check.

    Also it seems jqplot should be using twoDOuterArray but you are passing it data which might be a problem.

    One more thing: if you original data object contains more than one element, the outer <c:forEach> you have will result in jqplot overlaying new plots on the previously generated ones.

    Instead of mixing the JSTL with the Javascript I would also suggest building your 2d array from wherever your other variables are set (for example: a controller). Then convert the object to JSON with a library like Gson and pass that to jqplot directly.

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

Sidebar

Related Questions

Trying to create a list to return some JSON data to a view. Following
I am trying create a data.frame from which to create a graph. I have
I am trying create a layout. There are several inner layouts that should like
Trying to create an array of structs (new to C), but I am getting
I'm trying create a simple audio stream server like a concept proof, but I'm
I am trying create a WCF Data Services ServiceOperation that does grouping on the
I'm coding in Objective-C for the iPhone and I am trying create an array
I am trying create a WCF service that leverages the WPF MediaPlayer on the
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
I am trying create a delegate representation of constructor by emitting a Dynamic Method,

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.