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.
Unfortunately, activation email could not send to your email. Please try again.

LineSeries with two colors

Thread ID:

Created:

Updated:

Platform:

Replies:

132754 Sep 19,2017 09:34 AM Sep 21,2017 06:55 AM WPF 3
loading
Tags: SfChart
Timo Rüth
Asked On September 19, 2017 09:34 AM

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

Thanks
Timo


Durgadevi Selvaraj [Syncfusion]
Replied On September 20, 2017 10:15 AM

 
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 


Timo Rüth
Replied On September 20, 2017 10:18 AM

Thanks for the fast reply. I will try it.


Regards

Timo


Durgadevi Selvaraj [Syncfusion]
Replied On September 21, 2017 06:55 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;