We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Change Line color with Condition

Hi,

I want to ask if it is possible to change the line color of a line/spline chart when it hit a high or low value?    For example, my data ranges average from numeric value between 50 and 120.  So for value of below 50, I would like the line color to be orange and for value above 120 the line color is red.

Thank you. 

3 Replies

YP Yuvaraj Palanisamy Syncfusion Team July 11, 2016 06:10 PM UTC

Hi Albert, 

 

Thanks for contacting Syncfusion products. 

 

We have prepared a sample for your requirement by overriding the onDraw() method of line segment. Please find the attached sample from the below location. 

  

Sample: http://www.syncfusion.com/downloads/support/directtrac/159916/ze/LineSeries_Gradient1147242272  

  

Thanks, 

Yuvaraj 




AK Albert K replied to Yuvaraj Palanisamy July 12, 2016 07:59 AM UTC

Hi Albert, 

 

Thanks for contacting Syncfusion products. 

 

We have prepared a sample for your requirement by overriding the onDraw() method of line segment. Please find the attached sample from the below location. 

  

Sample: http://www.syncfusion.com/downloads/support/directtrac/159916/ze/LineSeries_Gradient1147242272  

  

Thanks, 

Yuvaraj 

Hi,


Thanks for the sample code.  The line color came out but the spline graph now looks like a line (no more smooth curve).  How do I achieve that?  Thank you.   


YP Yuvaraj Palanisamy Syncfusion Team July 13, 2016 07:10 PM UTC

Hi Albert,
 
Thanks for contacting Syncfusion support.
 
We have modified the sample as per your requirement with Spline series. Please check the modified sample and let us know if you have any clarifications.
 
Sample: http://www.syncfusion.com/downloads/support/forum/124948/ze/SplineSeries_Gradient1684261936 
 
Thanks,
Yuvaraj


SIGN IN To post a reply.
Loader.
Live Chat Icon For mobile
Up arrow icon