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).
Close Icon
Unfortunately, activation email could not send to your email. Please try again.
Close Icon
close icon
Vote for your favorite ebook
Succinctly Readers Awards 2020
Syncfusion Feedback

Change the line color

Thread ID:





117406 Oct 14,2014 06:44 PM UTC Oct 15,2014 11:38 AM UTC WPF 1
Tags: SfChart
Dustin Davis
Asked On October 14, 2014 06:44 PM UTC

I'm trying to change the line color on a line chart. I've tried everything I could find in the documentation, but the color remains the same. Same thing with the background and grid lines as well. They stay the same color. 

<UserControl x:Class="ScrollingChart"
             d:DesignHeight="300" d:DesignWidth="300">

        <Syncfusion:SfChart x:Name="Chart" Background="White" Margin="5,5,5,5">

                <Syncfusion:CategoryAxis x:Name="XAxis" ActualRangeChanged="XAxis_ActualRangeChanged" />


            <Syncfusion:LineSeries ScrollViewer.CanContentScroll="True" x:Name="XLineSeries"
                ItemsSource="{Binding Data}" 
        </Syncfusion:SfChart >

Mohammed Azarudeen [Syncfusion]
Replied On October 15, 2014 11:38 AM UTC

Hi Dustin,

Query: I'm trying to change the line color on a line chart

We have analyzed your requirement and you can achieve your requirement by setting the property Interior for LineSeries as shown in the below code snippet.

Code Snippet [XAML]:

            <chart:LineSeries Interior="Violet" XBindingPath="Text" YBindingPath="Value" ItemsSource="{Binding Data}"></chart:LineSeries>

 Query: Same thing with the background and grid lines as well. They stay the same color

You can achieve your requirement to set the background for the chart area by setting the property AreaBackground for the chart and you also can able to set the color for gridlines by setting the property MajorGridLineStyle for the axes  as shown in the below code snippet.

Code Snippet [XAML]:

<chart:SfChart x:Name="chart" AreaBackground="BlanchedAlmond">


                <chart:CategoryAxis  MajorGridLineStyle="{StaticResource gridLineStyle}"></chart:CategoryAxis>



We have prepared a sample based on this and please find the attached sample.

Please let us know if you have any queries.


Mohammed Azarudeen.


Attachment: LineSeriesInterior_fe14c2a4.zip


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