Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to change the colors of each box? #26

Open
kyrn0206 opened this issue Feb 7, 2018 · 2 comments
Open

how to change the colors of each box? #26

kyrn0206 opened this issue Feb 7, 2018 · 2 comments

Comments

@kyrn0206
Copy link

kyrn0206 commented Feb 7, 2018

hi,

how to change the fill & stroke colors of each box?

@nidhijohar
Copy link

You will need to console.log to know x value

if (this.x == "234") {
this.box = r.rect(this.x, this.y, box_width, this.size()).attr({
'fill': "#ff0000",
"stroke": "#D4CBF2"

          });
   
}
  else if (this.x == "654"){
    this.box = r.rect(this.x, this.y, box_width, this.size()).attr({
      'fill': "#ffa500",
      
      "stroke": "#D4CBF2"

    });
}
  else  {
    this.box = r.rect(this.x, this.y, box_width, this.size()).attr({

      'fill': "#008000",
      "stroke": "#D4CBF2"

    });
  }

@nidhijohar
Copy link

console.log(this.label_text);

  if (this.label_text == "A") {
  this.box = r.rect(this.x, this.y, box_width, this.size()).attr({
    'fill': "#ff0000",
    "stroke": "#D4CBF2"
         
          });
   
}
  else if (this.label_text == "B"){
    this.box = r.rect(this.x, this.y, box_width, this.size()).attr({
      'fill': "#ffa500",
       "stroke": "#D4CBF2"

    });
}
  else if (this.label_text == "C") {
    this.box = r.rect(this.x, this.y, box_width, this.size()).attr({

      'fill': "#008000",
      "stroke": "#D4CBF2"

    });
  }
  else  {
    this.box = r.rect(this.x, this.y, box_width, this.size()).attr({

      'fill': "#008000",
      "stroke": "#D4CBF2"

    });
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants