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

How to customize serie color

Hi, I have a SfChart with customized color series.

I have a SfDateTimeRangeNavigator and I want to use the same color. In the SfChart I can change the colors, but in the SfDateTimeRangeNavigator I do not see the option.

Thank you.

2 Replies

DP David Perera July 24, 2017 07:31 AM UTC

This is my code for the assigning the  Data (I can only do it in that way):

SfDateTimeRangeNavigator rangeNavigator = new SfDateTimeRangeNavigator();

rangeNavigator.SetBinding(SfDateTimeRangeNavigator.ItemsSourceProperty, "Line0ExtendedData");

rangeNavigator.XBindingPath = "XValue";

rangeNavigator.YBindingPath = "YValue";



SP Saravana Pandian Murugan Syncfusion Team July 25, 2017 10:52 AM UTC

Hi David, 
 
Thanks for using Syncfusion products. 
 
You can customize the colors of ChartSeries which you set as the Content of DateTimeRangeNavigator. Please find the code snippet below. 
  
Code Example: 
  
  
LineSeries lineSeries = new LineSeries(); 
  
lineSeries.Color = Color.Red;                     
  
lineSeries.SetBinding(ChartSeries.ItemsSourceProperty, "DateTimeRangeData"); 
  
lineSeries.XBindingPath = "XValue"; 
  
lineSeries.YBindingPath = "YValue"; 
  
contentChart.Series.Add(lineSeries); 
  
rangeNavigator.Content = contentChart; 
  
  
We have attached sample for your reference which can be downloaded from the below location. 
  
  
Please check the attached sample and let us know if you need further assistance on this. 
  
Regards, 
Saravana Pandian M. 


Loader.
Up arrow icon