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

Programatically Change Line Chart Series Interior Brush

'd like to display multiple series on the same chart.  When the user taps the chart, I'd like to highlight one or two series, and grey out the rest.  The user could then compare the series of interest to the trends of other series.

Something to the effect of:

        private void SfChart_Tapped(object sender, TappedRoutedEventArgs e)
        {
            if (series1 isActive) 
                { 
                   //Highlights two series
                     series1.Interior.Brush.Color  = Colors.Gray;
                     series2.Interior.Brush.Color  = Colors.Red;
                     series3.Interior.Brush.Color  = Colors.Red;
                {
   
             else if (series2 isActive)
                {
                     series2.Interior.Brush.Color  = Colors.Gray;
                     series3.Interior.Brush.Color  = Colors.Gray;;
                     series4.Interior.Brush.Color  = Colors.Red;
                {
             else
                {
                     series4.Interior.Brush.Color  = Colors.Gray;
                     series1.Interior.Brush.Color  = Colors.Red;
                {
        }

Not sure if this is a function built into some other aspect of syncfusion charts or what the appropriate properties are for the chart objects to achieve this behavior.


1 Reply

SJ Sumathi Jayaraj Syncfusion Team March 11, 2016 09:42 AM UTC

Hi Vincent,

Thanks for contacting Syncfusion Support.

SfChart allows user to highlight the series using ChartSelectionBehavior. We are able to highlight the series, while moving the mouse or mouse clicked (tap, in case of touch device) on the series. Multiple selection supports to highlight one or more series in chart. 

We have prepared a sample and it can be downloaded from the following location. 

Sample: SelectionSample

Please refer to the below link for more information.
Documentation Link: http://help.syncfusion.com/uwp/sfchart/interactive-features#selection 

Regards,
Sumathi J

Loader.
Live Chat Icon For mobile
Up arrow icon