Skip to content

Instantly share code, notes, and snippets.

@Divya1425
Last active September 28, 2017 09:44
Show Gist options
  • Save Divya1425/10958926061406d92c52a1ff70c046ed to your computer and use it in GitHub Desktop.
Save Divya1425/10958926061406d92c52a1ff70c046ed to your computer and use it in GitHub Desktop.
layout title description platform control documentation
post
Sparkline Axis
How to customize Axis in Essential Xamarin.Forms Sparkline
xamarin
Sparkline
ug

Sparkline Axis

Axis of the sparkline can be configured and customized using following properties. This feature is applicable for all the sparkline types except SfWinLossSparkline.

  • IsVisible - used to change the visibility of the axis.
  • StrokeColor - used to change the color of the axis.
  • StrokeWidth - used to change the width of the axis.
  • AxisOrigin - used to change the origin (positive or negative) of the axis.

{% tabs %}

{% highlight xaml %}

<sparkline:SfLineSparkline ItemsSource="{Binding Data}" YBindingPath="Performance">
sparkline:SfLineSparkline.Axis <sparkline:SparklineAxis IsVisible="true" StrokeColor="Red"/>

</sparkline:SfLineSparkline.Axis> </sparkline:SfLineSparkline>

{% endhighlight %}

{% highlight c# %}

SfLineSparkline lineSparkline = new SfLineSparkline() { YBindingPath = "Performance", ItemsSource = viewModel.Data, Axis = new SparklineAxis() { IsVisible = true, StrokeColor = Color.Red, } };

{% endhighlight %}

{% endtabs %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment