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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:14:51+00:00 2026-06-10T07:14:51+00:00

OK, this should be relatively simple : I’m adding a donut chart, which does

  • 0

OK, this should be relatively simple :

enter image description here

  • I’m adding a donut chart, which does work
  • However, the ‘legend’ (like Head (+) along with the corresponding colour) does NOT show up.

Code :

$(document).ready(function(){
  var s1 = [['Head (+)',<?php echo $headScore; ?>], ['Head (-)',<?php echo 6-$headScore; ?>]];
  var s2 = [['Body (+)',<?php echo $totalScore-$headScore; ?>], ['Body (-)',<?php echo 7-$totalScore+$headScore; ?>]];

  var plot3 = $.jqplot('linkchart', [s1,s2], {
      title:"Score Profile",
    seriesDefaults: {
      // make this a donut chart.
      renderer:$.jqplot.DonutRenderer,
      rendererOptions:{
        // Donut's can be cut into slices like pies.
        sliceMargin: 3,
        // Pies and donuts can start at any arbitrary angle.
        startAngle: -90,
        showDataLabels: false
      },
      legend: { show:true, location: 'e' }
    }
  });
});

What am I doing wrong?

  • 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-10T07:14:53+00:00Added an answer on June 10, 2026 at 7:14 am

    Kameleon,

    It looks like you have done a silly mistake. : )

    First end the seriesDefaults property and then define the legend.

    You have placed the legend inside the seriesDefaults.

    var plot3 = $.jqplot('linkchart', [s1,s2], {
        title:"Score Profile",
            seriesDefaults: {
                // make this a donut chart.
                renderer:$.jqplot.DonutRenderer,
                rendererOptions:{
                    // Donut's can be cut into slices like pies.
                    sliceMargin: 3,
                    // Pies and donuts can start at any arbitrary angle.
                    startAngle: -90,
                    showDataLabels: false
                } // Not here...
            },
            //Place the legend here....
            legend: { show:true, location: 'e' }
        });
    });
    

    I have not tested it. But I think it should work.

    Thank you.

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

Sidebar

Related Questions

Okay, this seems like it should be relatively simple, but I've been Googling for
This looks like it should be a relatively simple query but can someone please
Setup OSX 10.7.4 Eclipse Indigo, Pydev, Tweepy-1.9 I thought this should be relatively simple
This seems like it should be relatively straightforward, I cannot figure out what I'm
This should be quite simple, but I can't work out the syntax. I have
This seems like it should be fairly simple, but for some reason I can't
this question should be relatively simple and shouldnt even require much explanation i dont
This should be relatively straight forward however I'm being swamped in SQL information whenever
I have written a relatively simple Java App Engine application which I would like
This should be relatively simple, here is my situation; I have copied the trunk

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.