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
close icon

Axis Colour

When I create a SfChart the default colour of the axis lines is white, and they must be displayed on a dark background. Is there anyway to change the color of the axis lines to black?  

1 Reply

DS Durgadevi Selvaraj Syncfusion Team September 28, 2017 01:08 PM UTC

Hi Mick, 
Thanks for contacting Syncfusion Support. 
We have analyzed your requirement (changing the color of the axis lines to black) and can achieve it by setting AxisLineStyle to the Axis as shown in the below code, 
       <Style x:Key="axisLineStyle" TargetType="Line"> 
           <Setter Property="Stroke" Value="Black"/> 
           <Setter Property="StrokeThickness" Value="3"/> 
        <syncfusion:SfChart Margin="10"  > 
                <syncfusion:CategoryAxis  AxisLineStyle="{StaticResource axisLineStyle}" /> 
                <syncfusion:NumericalAxis AxisLineStyle="{StaticResource axisLineStyle}" /> 
            <syncfusion:LineSeries  ItemsSource="{Binding Collection}"   XBindingPath="XValue" YBindingPath="YValue"/> 
We have prepared a sample based your requirement and it can be downloaded from the below link, 
Durgadevi S 

Live Chat Icon For mobile
Up arrow icon