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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:53:35+00:00 2026-06-18T01:53:35+00:00

I have a line graph that is displaying variable information (% figure each month

  • 0

I have a line graph that is displaying variable information (% figure each month for the last 12 months)

I would like to change the dot colour of each plot based on the result that I recieved from a Ajax call to php function. (refer to the green line)

for example below is my graph:
My Graph

if the figure for the month is > 98.5 make the dot green, If the figure is between 96 – 98.5 make the dot amber and anything lower make the dot red.

Is this possible?

i tried returning an array of colours back to my ajax method and tried:
name: ‘Production Success Rate’,
color: ‘responseJSON.colour,
type: ‘line’,
data: responseJSON.percent

the array responseJSON.colour that is returned is an array of hex codes.

however it seems that the color api does not allow an array as it only colours the line with the first colour in the array (unfortunatly)

can anyone help?

  • 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-18T01:53:36+00:00Added an answer on June 18, 2026 at 1:53 am

    I believe what you want is to leverage the fillColor of each series point.

    This can be done by manually building the data that’s to be prepared for the chart, a quick example would be:

    var figures = [93, 95.8, 99.2, 97.8, 98.3, 96.4, 95, 98.9, 97.2, 94.3, 97.1, 94],
            d = [];
    
    $.each(figures, function (i, figure) {
        if (figure > 98.5) {
            d.push({y: figure, fillColor: 'green', color: 'green'});
        }else if(figure < 98.5 && figure > 96.5){
            d.push({y: figure, fillColor: '#ffbf00', color: '#ffbf00'});  //amber i guess
        }else if(figure < 96.5){
            d.push({y: figure, fillColor: 'red', color: 'red'});   
        }
    }); 
    

    Then when you build the chart, simply supply data: d and each of the dots will have a different fill color based on the above conditional..

    I think this jsFiddle probably covers most of what you need.

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

Sidebar

Related Questions

I have a ggplot graph that I would like to insert custom string below
I want to Draw multiple line Graph with each line have different color and
I have a process that refreshes a 1000 line graph while a TrackBar scrolls.
I'm using nvd3.js to create a line graph that displays ratings that I have
I would like to animate a graph that grows over time. This is what
I have a pretty simple line graph that is rendered by the code below.
I would like to draw a straight line that makes the average of a
I have a highcharts line graph that shows sales data. Is there a way
I have a web page that displays a long line graph inside a div
I have graph i want that graph it should show in whole number like

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.