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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:17:34+00:00 2026-06-16T00:17:34+00:00

I am having problems plotting my pie chart using jqplot. After getting my results

  • 0

I am having problems plotting my pie chart using jqplot.

After getting my results from php i have converted it to json using json_encode. The output is

{"a":2,"b":1,"c":5,"d":650}

Now when i try to put these results into my javascript

<script class="code" type="text/javascript">
$(document).ready(function(){
    // method 1
    //var data1 = document.getElementById("dataArray").value;
    //eval('data1 = '+data+';');

    // method 2
    var data1 = <?php echo json_encode($data); ?>;

    var plot1 = jQuery.jqplot ('Chart', [data1], 
    { 
        seriesDefaults: {
            // Make this a pie chart.
            renderer: jQuery.jqplot.PieRenderer, 
            rendererOptions: {
                // Put data labels on the pie slices.
                // By default, labels show the percentage of the slice.
                showDataLabels: true
            }
        }, 
        legend: { show:true, location: 'e' }
    }
    );
});
</script>

I’ve tried two methods, the first to put it inside a hidden field, and the second to retrieve straight from PHP. Both of which result in Uncaught. No plot target specified errors in my Chrome console.

What is it I am doing wrong here?

Thanks guys.

  • 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-16T00:17:35+00:00Added an answer on June 16, 2026 at 12:17 am

    As Asad mentioned, my stupid mistake was that Chart was not specified as an element. So yeah if anyone else ever comes into the same problem, be sure to check that out. 🙂

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

Sidebar

Related Questions

Having problems getting the different arrays content from geocoder results. item.formatted_address works but not
I' having problems getting the selected value from an autocomplete-combobox jquery widget. Although I've
Anyone having problems with upgrading Store from 1.5.3 to 1.6.0 ? A PHP Error
I'm having problems with a query in mysql. For plotting a chart, I'm creating
Having problems returning a list of Japanese terms from an MSSql database as JSON.
Im having problems getting at the HTML5 video tag with jQuery. Here is my
Im having problems with classpaths. I have used them before with import but I'm
I'm having problems with trying to catch an error. I'm using Pyramid/SQLAlchemy and made
Having problems with IE8... I have a button that onclick fires the showImageBrowser() function.
I´m having problems using VichUploaderBundle. Uploads files correctly, but when I write <td><img src=<img

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.