ChartDashboardLayoutItem Class

Allows you to specify the style and templates to customize the ChartDashboardItem appearance.

Namespace: DevExpress.DashboardWpf

Assembly: DevExpress.Xpf.Dashboard.v21.1.dll

Declaration

public class ChartDashboardLayoutItem :
    DashboardLayoutItem

Remarks

When you create a custom ChartDashboardLayoutItem template, bind the DashboardLayoutItem.ViewStyle property to the Style property of the underlying Chart control or bind the following styles to the underlying control’s objects:

The following code snippet shows how to enable scale breaks for a Chart dashboard item:

wpf-dashboard-chart-scale-breaks

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dxdash="http://schemas.devexpress.com/winfx/2008/xaml/dashboard" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
    mc:Ignorable="d"
    Title="MainWindow" Height="450" Width="800">
  <Window.Resources>

  <!--Create the template to enable the AutoScaleBreaks property.-->
  <DataTemplate x:Key="chartTemplate">
      <dxc:ChartControl Style="{Binding Path=(dxdash:DashboardLayoutItem.ViewStyle), RelativeSource={RelativeSource TemplatedParent}}">
          <dxc:XYDiagram2D>
              <dxc:XYDiagram2D.SecondaryAxisYItemTemplate>
                  <DataTemplate>
                      <dxc:SecondaryAxisY2D Style="{Binding Path=(dxdash:ChartDashboardLayoutItem.SecondaryAxisYStyle), RelativeSource={RelativeSource Self}}">
                          <dxc:SecondaryAxisY2D.AutoScaleBreaks>
                              <dxc:AutoScaleBreaks Enabled="True"/>
                          </dxc:SecondaryAxisY2D.AutoScaleBreaks>
                      </dxc:SecondaryAxisY2D>
                  </DataTemplate>
              </dxc:XYDiagram2D.SecondaryAxisYItemTemplate>
          </dxc:XYDiagram2D>
      </dxc:ChartControl>
  </DataTemplate>  
  </Window.Resources>
    <Grid>
        <dxdash:DashboardControl Grid.Column="0"  x:Name="dashboardControl1" 
                                 DashboardSource="../../Dashboards/dashboard1.xml" 
                                 BorderThickness="3" >
            <!--Apply the template to the Chart dashboard item.-->
            <dxdash:DashboardControl.ChartItemStyle>
                <Style TargetType="dxdash:ChartDashboardLayoutItem">
                    <Setter Property="ContentTemplate" Value="{StaticResource chartTemplate}" />
                </Style>
            </dxdash:DashboardControl.ChartItemStyle>
        </dxdash:DashboardControl>
    </Grid>
</Window> 
TIP

For a complete list of dashboard item styles, see A List of Styles and Templates.

Inheritance

See Also