Skip to main content

How to: Use Themes to Define the Look and Feel of Your Chart

This example demonstrates how to apply a theme that defines the overall look and feel of a chart by painting its main elements.

View Example

<Window x:Class="ChartTheme.MainWindow"
        Title="MainWindow" Height="350" Width="525" >
        <!--Make sure to add the corresponding assembly to the References list of your project, 
        and define the ThemeManager.ThemeName property at the chart control's level.-->
        <dxc:ChartControl  core:ThemeManager.ThemeName="LightGray">
                        <dxc:LineSeries2D DisplayName="Series 1">
                                <dxc:SeriesPoint Argument="A" Value="-120" />
                                <dxc:SeriesPoint Argument="B" Value="270" />
                                <dxc:SeriesPoint Argument="C" Value="-160" />
                                <dxc:SeriesPoint Argument="D" Value="340" />
                        <dxc:LineSeries2D DisplayName="Series 2">
                                <dxc:SeriesPoint Argument="A" Value="120" />
                                <dxc:SeriesPoint Argument="B" Value="-270" />
                                <dxc:SeriesPoint Argument="C" Value="160" />
                                <dxc:SeriesPoint Argument="D" Value="-340" />
                <dxc:Legend />
                <dxc:Title Content="How to Use Themes" />