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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:41:06+00:00 2026-06-09T07:41:06+00:00

I want to specify colors for certain piece for my pie chart. I wrote

  • 0

I want to specify colors for certain piece for my pie chart.

I wrote some code like this, but it seems not working. Anyone got clue how to work around with this?

{
                name: data[i].status, 
                color: function() {
                    if (data[i].status === "Working") {
                        return '#60a57c';
                    } else if (data[i].status === "Stopped \/ Idle") {
                        return '#e7494d';
                    } else if (data[i].status === "Transport") {
                        return '#fac101';
                    } else if (data[i].status === "Headland Turning") {
                        return '#66cc13';
                    }
                },
                y: data[i].val
            } 

Basically what I want is if the status is "Working", then we specify color as "#60a57c", etc. I don’t want HighChart auto-generate colors for me.

Thank you.

  • 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-09T07:41:07+00:00Added an answer on June 9, 2026 at 7:41 am

    color have to be a string.

    So try the following:

    var colors = {
        'Working': '#60a57c',
        'Stopped \/ Idle': '#e7494d',
        'Transport': '#fac101',
        'Headland Turning': '#66cc13'
    };
    
    var serie = {
        name: data[i].status,
        color: colors[data[i].status],
        y: data[i].val
    };
    

    Hope this help you.

    Reference

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

Sidebar

Related Questions

I very often want to use dynamic finders to specify NOT NULL. So… this
I have a pie chart and want to specify an exact color for a
Can I specify I want the preceding character to be either (NOT A DIGIT)
I would like to specify that I want FEATURE_INDETERMINATE_PROGRESS for my Activity . It
How to Specify NOT with Regular Expressions for Words I want to filter a
I have designed specified some CSS style for general hyperlinks. I want to specify
Ok, I want this: For that, I have this HTML code: <div id=wrapForCenter> <div
I want to specify two slightly different background colors, one for Mac OS, one
I want to specify a project to be opened when I launch Delphi(D2010). Is
I want to specify that either fieldname or freetext must always be present in

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.