Articles in this section
Category / Section

How to apply shadow effects for the LineSeries in UWP Chart (SfChart)?

This article explains how to apply shadow effects for the LineSeries in UWP Chart. By leveraging the DropShadowPanel from the Microsoft Toolkit, you can enhance the visual appearance of your chart series.

Step 1: To include the DropShadowPanel, add the Microsoft.Toolkit.Uwp.UI.Controls NuGet package to your project.

Step 2: Add the toolkit namespace in your XAML file to reference the DropShadowPanel control.

xmlns:toolkit="using:Microsoft.Toolkit.Uwp.UI.Controls"

Step 3: Apply the shadow effect by customizing the LineSeries template. Inside the CustomTemplate of the LineSeries, place the DropShadowPanel and with a Line element inside it. Bind the X1, X2, Y1, and Y2 properties to render the line with a shadow effect.

<chart:SfChart x:Name="chart" Margin="20">
        . . .
        <chart:LineSeries XBindingPath="XValue" 
                          YBindingPath="YValue" 
                          ItemsSource="{Binding Data}">
        <chart:LineSeries.CustomTemplate>
            <DataTemplate>
                <Border>
                    <toolkit:DropShadowPanel>
                        <Line X1="{Binding X1}" 
                              X2="{Binding X2}" 
                              Y1="{Binding Y1}" 
                              Y2="{Binding Y2}" 
                              Stroke="{Binding Interior}" />
                    </toolkit:DropShadowPanel>
                </Border>
            </DataTemplate>
        </chart:LineSeries.CustomTemplate>
    </chart:LineSeries>
    . . .
</chart:SfChart>

Output

After implementing the above steps, the line rendered in the LineSeries will display a shadow effect provided by the DropShadowPanel.

Output image showing Shadow effect for line chart in UWP

Conclusion

 I hope you enjoyed learning about how to apply shadow effects for the Line Series in UWP Chart.

You can refer to our UWP Chart’s feature tour page to know about its other groundbreaking feature representations. You can also explore our UWP Chart’s documentation to understand how to present and manipulate data.

For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our WinForms Diagram and other WinForms components.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied