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.

How to control line colors in sfChart Line char type

Thread ID:

Created:

Updated:

Platform:

Replies:

117645 Nov 22,2014 04:39 AM Nov 26,2014 12:22 AM WinRT 3
loading
Tags: Chart
Rob Kerr
Asked On November 22, 2014 04:39 AM

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}"
                                                     StrokeThickness="2"/>

Sumathi Jayaraj [Syncfusion]
Replied On November 24, 2014 11:07 AM

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.

 

Regards,

Sumathi J


Rob Kerr
Replied On November 25, 2014 11:46 AM

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

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

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

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.

;