Customize segment brush in WPF Sparkline (SfSparkline)
23 Oct 2019 / 1 minute to read
We can able to customize the first, last, negative, high and low point brushes as like markers in area and line sparkline.
<Syncfusion:SfColumnSparkline ItemsSource="{Binding UsersList}" YBindingPath="NoOfUsers" >
<Syncfusion:SfColumnSparkline.SegmentTemplateSelector>
<Syncfusion:SegmentTemplateSelector FirstPointBrush="Yellow" LastPointBrush="Yellow" HighPointBrush="Red"/>
</Syncfusion:SfColumnSparkline.SegmentTemplateSelector>
</Syncfusion:SfColumnSparkline>
SfColumnSparkline sparkline = new SfColumnSparkline()
{
ItemsSource = new SparkViewModel().UsersList,
YBindingPath = "NoOfUsers"
};
SegmentTemplateSelector selector = new SegmentTemplateSelector()
{
FirstPointBrush = new SolidColorBrush(Colors.Yellow),
LastPointBrush = new SolidColorBrush(Colors.Yellow),
HighPointBrush = new SolidColorBrush(Colors.Red)
};
sparkline.SegmentTemplateSelector = selector;
Following is the snapshot for customize segment,
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page