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

LineSeries with two colors

Hello,
Is it possible to draw a LineSeries with two Colors? Like this one:

Thanks
Timo


3 Replies

DS Durgadevi Selvaraj Syncfusion Team September 20, 2017 02:15 PM UTC

 
Thanks for contacting Syncfusion Support. 
 
We can achieve your requirement (displaying Line series with two colors) by setting Palette as Custom and custom brushes to the ColorModel property of the chart series as shown in the below code, 
 
MainWindow.xaml: 
 
<chart:StepLineSeries ItemsSource="{Binding Collection}" Palette="Custom" XBindingPath="XValue" YBindingPath="YValue"> 
      <chart:StepLineSeries.ColorModel> 
           <chart:ChartColorModel> 
                <chart:ChartColorModel.CustomBrushes> 
                    <SolidColorBrush Color="Blue"/> 
                    <SolidColorBrush Color="DeepPink"/> 
                </chart:ChartColorModel.CustomBrushes> 
           </chart:ChartColorModel> 
       </chart:StepLineSeries.ColorModel> 
  </chart:StepLineSeries> 
 
Please find the output screenshot below, 
 
 
You can refer our UG Documentation link to know more about this property, 
 
We have prepared the sample for your reference and please find the sample from below link, 
Regards,  
Durgadevi S 



TR Timo Rüth September 20, 2017 02:18 PM UTC

Thanks for the fast reply. I will try it.


Regards

Timo



DS Durgadevi Selvaraj Syncfusion Team September 21, 2017 10:55 AM UTC

Hi Timo, 
 
Thanks for your response and we will wait until hear from you.  
 
Regards,  
Durgadevi S 


Loader.
Live Chat Icon For mobile
Up arrow icon