Implementaion of dashed line and plain line in a single line chart

Hello,

I am looking to create a single line graph where the line will be a plain line upto certain points and after that it will change to dashed - line. I could not find any solution can anyone help me to find the solution if possible.

Thank You


3 Replies

YG Yuvaraj Gajaraj Syncfusion Team October 18, 2021 11:55 AM UTC

Hi Chiratna Chakraborty, 
  
Greeting from Syncfusion. We have analyzed your query, and your requirement can be achieved using the onCreateRenderer callback in the series. We have created a sample, and this can be customized based on your scenario. 
  
Screenshot: 
 
  
  
  
Kindly get back to us, if you have further queries. 
  
Regards, 
Yuvaraj. 



CC Chiratna Chakraborty October 18, 2021 12:57 PM UTC

Hello,

Thanks for the solution. I am using DateTime input as X axis  input, and i could not figure out how to start the dashed line from a particular date. It would be nice if you kindly help me with this.

Thanks



YG Yuvaraj Gajaraj Syncfusion Team October 19, 2021 03:02 PM UTC

Hi Chiratna Chakraborty, 
 
We have analyzed your request, and we would like to suggest you use the series property which is having the data source. So, you can get the x value from that and compare it with the date-time where you want to start the dashed line rendering part. We have prepared a simple sample for this scenario, and you can find the code below. 
 
 
series.dataSource[currentSegmentIndex].x.compareTo(DateTime (2018,01,01)) < 0 
 
 
We have also attached the sample below for you reference. 
 
  
Regards, 
Yuvaraj.

Loader.
Up arrow icon