How to set Interior color AND use SegmentTemplateSelector to set LastPointBrush?

If I don't have a SegmentTemplateSelector I am able to set the color of the SfColumnSparkline columns to my desired color. 

However, when I add a SegmentTempleteSelector as described in the User Guide (https://help.syncfusion.com/wpf/sparkline/customize-segment-brush) The columns that are NOT first, last, high, low, or negative default to a blue color that is not my desired color.  I cannot find a setting inside the SegmentTemplateSelector to set the brush for all non-special columns, and the examples only set the colors for the special columns. Please help!

Here is my code; the columns should be the color of {DynamicResource _appColorBrush}, not default blue.

                        <chart:SfColumnSparkline Grid.Column="0" Padding="0" Interior="{DynamicResource _appColorBrush}" Margin="5 5 5 0"
                                     ItemsSource="{Binding ItsStatsCollectionViewSource.View}" YBindingPath="ItsGraphedDownload"
                                     MaximumYValue="0" MinimumYValue="{Binding ItsInvertedMaximumGraphedYValue}">
                            <chart:SfColumnSparkline.SegmentTemplateSelector>
                                <chart:SegmentTemplateSelector LastPointBrush="Tomato"/>
                            </chart:SfColumnSparkline.SegmentTemplateSelector>
                        </chart:SfColumnSparkline>


3 Replies 1 reply marked as answer

RS Ramya Soundar Rajan Syncfusion Team June 15, 2020 12:02 PM UTC

Hi Ryan, 
 
Greetings from Syncfusion. 
 
We would like to let you know that if you set color for Interior property then the color will be set to the column other than FirstPointBrush, LastPointBrush, NegativePointBrush, LowPointBrush and HightPointBrush. So, if you want to set same color other than the LastPointBrush value as tomato then you can achieve like in below code snippet. 
 
 
    <Grid> 
        <Grid.Resources> 
            <local:UsersViewModel x:Key="model"/> 
            <SolidColorBrush x:Key="colorKey" Color="Green"/> 
        </Grid.Resources> 
 
        <Syncfusion:SfColumnSparkline x:Name="sparkline" Padding="0" Interior="{DynamicResource colorKey}" Margin="5 5 5 0" 
                      ItemsSource="{Binding UsersList}" YBindingPath="NoOfUsers" 
                              DataContext="{StaticResource model}"  
             
            <Syncfusion:SfColumnSparkline.SegmentTemplateSelector> 
                <Syncfusion:SegmentTemplateSelector LastPointBrush="Tomato"  
                                                    NegativePointBrush="{Binding Source={StaticResource model},Path=CustomColor}" 
                                                    LowPointBrush="{Binding Source={StaticResource model},Path=CustomColor}" 
                                                    HighPointBrush="{Binding Source={StaticResource model},Path=CustomColor}" 
                                                    FirstPointBrush="{Binding Source={StaticResource model},Path=CustomColor}"/> 
            </Syncfusion:SfColumnSparkline.SegmentTemplateSelector> 
        </Syncfusion:SfColumnSparkline> 
    </Grid> 
 
 
Output: 
 
 
 
Please check with the above sample and if the reported problem different from this please provide the additional details about the issue or modify the above sample with the issue reproducing steps which will be helpful for us to analyze further and provide an appropriate solution. 
 
Regards, 
Ramya S 


Marked as answer

RW Ryan Woodings June 15, 2020 07:04 PM UTC

I was using 17.x version of the Syncfusion library. Upgrading to 18.x fixed the issue :-)


SP Sakthivel Palaniyappan Syncfusion Team June 16, 2020 06:57 AM UTC

Hi Ryan,

Thanks for the update.

We are glad to know that reported problem has been resolved at your end. Please let us know if you need further assistance on this.

Regards,
Sakthivel P.
 


Loader.
Up arrow icon