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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:43:44+00:00 2026-06-05T11:43:44+00:00

I am having an issue with raphael pie charts. The data I am using

  • 0

I am having an issue with raphael pie charts. The data I am using is dynamic, and in some instances, only 1 value is returned, meaning the whole chart is filled, as it is the ONLY slice. The problem is that when there is only 1 value, it ignores my color designation.

For example: Below is the creation of a raphael pie chart with 2 values, and each slice has the proper color designated in the “colors” section:

var r = Raphael("holder");  
r.piechart(160, 136, 120, [100,200],{colors: ["#000","#cecece"]});

This works fine, and I get two properly sized slices, one black, and one grey.

However the example below creates one full pie, ALWAYS filled with blue, regardless of my color setting.

var r = Raphael("holder");  
r.piechart(160, 136, 120, [100],{colors: ["#000"]});

In this situation, I really need that full pie to be black, as it is set in “colors”

Am I doing something wrong, or is this a bug?

  • 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-05T11:43:46+00:00Added an answer on June 5, 2026 at 11:43 am

    INMO its a bug cause when the pie got only one slice its color is hard coded…

    Here is how I solved it (all I did is use the colors arg if it exist…)

    in g.pie.js after line 47 add this

    var my_color =  chartinst.colors[0];
    if(opts.colors !== undefined){
        my_color =  opts.colors[0];
    }
    

    then in the following line (line 48 in the original js file)

    series.push(paper.circle(cx, cy, r).attr({ fill: chartinst.colors[0]....
    

    replace the chartinst.colors[0] with my_color

    that’s it

       if (len == 1) {
            var my_color =  chartinst.colors[0];
            if(opts.colors !== undefined){
                my_color =  opts.colors[0];
            }
            series.push(paper.circle(cx, cy, r).attr({ fill: my_color,   ....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having issue when sending data from Service to Activity through Notification ,
We are using MSDTC for SQL transactions. I am having issue with setting up
Having issue with displaying the Data from a second Activity. when I run the
I am having issue with my pagemethod + url rewrite. When using regular URL:
I am having issue in checking which input has been clicked using unobstructive javascript.
I'm having issue working with json_decode() in PHP. Im using the json2.js library to
I am trying to implement BST algorithm using Cormen's pseudo code yet having issue.
I'm having issue assigning regex value to a string. Issue that I have is
I'm having issue with calling a method with l-value of an abstract class. The
I am having issue making a form be sent using ajax. Here is my

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.