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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to control line colors in sfChart Line char type

Thread ID:





117645 Nov 22,2014 09:39 AM UTC Nov 26,2014 05:22 AM UTC WinRT 3
Tags: Chart
Rob Kerr
Asked On November 22, 2014 09:39 AM UTC

How can I set the color of a line in a line chart?  I have these two lines, and they are assigned automatically colors about Blue and Brown, but I want to pick the color myself.

I tried using Stroke and Border attributes, but neither of those affect the line color.  StrokeWidth does change the width. Palette works, but of course it's not what I want (I want the entire line the same color).

<SFCharts:LineSeries Label="YTD Billable Hours" XBindingPath="FirstDayOfMonth" YBindingPath="YtdBillableHours" ItemsSource="{Binding MonthlyHoursVsBudget}"
                                                     StrokeThickness="2" ShowTooltip="True" TooltipTemplate="{StaticResource MonthlyHoursDataTemplate}"/>
<SFCharts:LineSeries Label="YTD Budget" XBindingPath="FirstDayOfMonth" YBindingPath="YtdBudgetBillableHours" ItemsSource="{Binding MonthlyHoursVsBudget}"

Sumathi Jayaraj [Syncfusion]
Replied On November 24, 2014 04:07 PM UTC

Hi Rob,


Thank you for using Syncfusion products.


SfChart provides the API for defining the color of the individual series. By default, Metro palette will applied for the series. You can define the color using Interior property as in below code snippet.


Code snippet:


<chart:LineSeries XBindingPath="Name" Interior="Red" ShowTooltip="True" StrokeThickness="2" ItemsSource="{Binding power}" Label="Sports" YBindingPath="Sports"/>


Note : For the series like line and spline, Stroke is not applicable.



Sumathi J

Rob Kerr
Replied On November 25, 2014 04:46 PM UTC

Thanks, Sumathi.  The "Interior" property was exactly what I needed to know.  Works great!

Magesh Kumar Krishnan [Syncfusion]
Replied On November 26, 2014 05:22 AM UTC

Hi Rob,
Thanks for the update. Please let us know if you require further assistance on this.
Magesh Kumar K


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon