cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

CSS for formatting the reference lines of a line chart

JK_10744682
13-Aquamarine

CSS for formatting the reference lines of a line chart

@Jam_Kirko 

Could you possibly share the CSS for changing a reference line color if you still have it--from this topic?  

 

ACCEPTED SOLUTION

Accepted Solutions

@supports (ptcs-style-unit: "PTCS-CHART-COORD") {
  [part~="y-refline"]:nth-child(1){
    background: repeating-linear-gradient(to right, red, red 4px, transparent 5px, transparent 8px);
    width: 100%;
    height: 2px;
  }
  [part~="y-refline"]:nth-child(2){
    background: repeating-linear-gradient(to right, green, green 4px, transparent 5px, transparent 8px);
    width: 100%;
  }
  [part~="y-refline"]:nth-child(3){
    background: repeating-linear-gradient(to right, blue, blue 4px, transparent 5px, transparent 8px);
    width: 100%;
  }   
  [part~="y-refline"]:nth-child(4){
    background: repeating-linear-gradient(to right, rgb(243 192 17), rgb(243 192 17) 4px, transparent 5px, transparent 8px);
    width: 100%;
  }      
}

Sathishkumar_C_1-1758780636461.png

 

Try to use the above CSS.

View solution in original post

3 REPLIES 3

Hi @JK_10744682   

  • Beginning with ThingWorx Platform 9.3.4, configuring different colors for reference lines is possible through Custom CSS code
@supports (ptcs-style-unit: "PTCS-CHART-COORD") {
  [part~="refline"]:nth-child(1){
    background-color:yellow;
  }
  [part~="refline"]:nth-child(2){
    background-color:red;
  }
}

This is very helpful. Do you know of a way to get the colors to be by reference line number rather than coordinates? I want specific reference lines to be certain color but the CSS you showed has it so that the highest value line is one color and so on. 

@supports (ptcs-style-unit: "PTCS-CHART-COORD") {
  [part~="y-refline"]:nth-child(1){
    background: repeating-linear-gradient(to right, red, red 4px, transparent 5px, transparent 8px);
    width: 100%;
    height: 2px;
  }
  [part~="y-refline"]:nth-child(2){
    background: repeating-linear-gradient(to right, green, green 4px, transparent 5px, transparent 8px);
    width: 100%;
  }
  [part~="y-refline"]:nth-child(3){
    background: repeating-linear-gradient(to right, blue, blue 4px, transparent 5px, transparent 8px);
    width: 100%;
  }   
  [part~="y-refline"]:nth-child(4){
    background: repeating-linear-gradient(to right, rgb(243 192 17), rgb(243 192 17) 4px, transparent 5px, transparent 8px);
    width: 100%;
  }      
}

Sathishkumar_C_1-1758780636461.png

 

Try to use the above CSS.

Announcements


Top Tags