WPF Chart - Examples
SciChart WPF ships with hundreds of WPF Chart Examples which you can browse, play with, view the source-code and even export each WPF Chart Example to a stand-alone Visual Studio solution. All of this is possible with the new and improved SciChart WPF Examples Suite, which ships as part of the SciChart WPF SDK.
Demonstrates the many kinds of Stacked chart (Stacked Mountain, Stacked Column, 100% Stacked Column) available in SciChart, and allows MS Excel style changing of data-presentation dynamically.
Example Usage
To change chart type – just select item in the list at the top.
– Animated/NonAnimated Zoom/Zoom Extents.
– Show/Hide Labels inside columns.
– Change SpacingMode : Absolute or Relative.
– Change Spacing between columns using Slider.
– Change DataPoinWidth using Slider.
– Show/Hide series using CheckBoxes inside legend.
Documentation Links
– Introduction to Stacked Series in SciChart
– StackedMountainRenderableSeries Type
– StackedColumnRenderableSeries Type
The C#/WPF source code for the WPF Dashboard Style Column Charts example is included below (Scroll down!).
Did you know you can also view the source code from one of the following sources as well?
- Clone the SciChart.WPF.Examples from Github.
- Or, view source in the SciChart WPF Examples suite.
- Also the SciChart WPF Trial contains the full source for the examples (link below).
ChartTypeViewModel.cs
View source code// *************************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2022. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// ChartTypeViewModel.cs is part of the SCICHART® Examples. Permission is hereby granted
// to modify, create derivative works, distribute and publish any part of this source
// code whether for commercial, private or personal use.
//
// The SCICHART® examples are distributed in the hope that they will be useful, but
// without any warranty. It is provided "AS IS" without warranty of any kind, either
// expressed or implied.
// *************************************************************************************
using System;
using System.Collections.Generic;
using SciChart.Charting.Model.ChartSeries;
using SciChart.Charting.Visuals.RenderableSeries;
using SciChart.Examples.ExternalDependencies.Common;
namespace SciChart.Examples.Examples.CreateMultiseriesChart.DashboardStyleCharts
{
public class ChartTypeViewModel : BaseViewModel
{
private string _typeName;
private bool _isOneHundredPercent;
private readonly bool _isSideBySide;
public ChartTypeViewModel(IEnumerable<IRenderableSeriesViewModel> rSeriesViewModels, Type type, bool isOneHundredPercent, bool isSideBySide)
{
RenderableSeriesViewModels = rSeriesViewModels;
_isOneHundredPercent = isOneHundredPercent;
_isSideBySide = isSideBySide;
_typeName = GenerateChartName(type);
}
#region Properties
public IEnumerable<IRenderableSeriesViewModel> RenderableSeriesViewModels { get; set; }
public string TypeName
{
get { return _typeName; }
set
{
_typeName = value;
OnPropertyChanged("TypeName");
}
}
public bool IsOneHundredPercent
{
get { return _isOneHundredPercent; }
set
{
_isOneHundredPercent = value;
OnPropertyChanged("TypeName");
}
}
public bool IsSideBySide
{
get { return _isSideBySide; }
}
public string AxisFormatting
{
get { return _isOneHundredPercent ? "#0'%'" : ""; }
}
#endregion
private string GenerateChartName(Type type)
{
string result = _isOneHundredPercent ? "100% " : "";
if (type == typeof (IStackedColumnRenderableSeries))
{
result += "Stacked columns";
if (_isSideBySide)
{
result += " side-by-side";
}
}
else
{
result += "Stacked mountains";
}
return result;
}
}
}ChartTypeViewModelFactory.cs
View source codeDashboardDataHelper.cs
View source code// *************************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2022. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// DashboardDataHelper.cs is part of the SCICHART® Examples. Permission is hereby granted
// to modify, create derivative works, distribute and publish any part of this source
// code whether for commercial, private or personal use.
//
// The SCICHART® examples are distributed in the hope that they will be useful, but
// without any warranty. It is provided "AS IS" without warranty of any kind, either
// expressed or implied.
// *************************************************************************************
namespace SciChart.Examples.Examples.CreateMultiseriesChart.DashboardStyleCharts
{
public static class DashboardDataHelper
{
private static readonly double[] XValues = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
private static readonly double[][] YValues =
{
new double[] {10, 13, 7, 16, 4, 6, 20, 14, 16, 10, 24, 11},
new double[] {12, 17, 21, 15, 19, 18, 13, 21, 22, 20, 5, 10},
new double[] {7, 30, 27, 24, 21, 15, 17, 26, 22, 28, 21, 22},
new double[] {16, 10, 9, 8, 22, 14, 12, 27, 25, 23, 17, 17},
new double[] {7, 24, 21, 11, 19, 17, 14, 27, 26, 22, 28, 16}
};
private static readonly string[] ColumnStyleKeys =
{
"StackedColumnBlueStyle",
"StackedColumnOrangeStyle",
"StackedColumnRedStyle",
"StackedColumnGreenStyle",
"StackedColumnVioletStyle"
};
private static readonly string[] MountainStyleKeys =
{
"StackedMountainBlueStyle",
"StackedMountainOrangeStyle",
"StackedMountainRedStyle",
"StackedMountainGreenStyle",
"StackedMountainVioletStyle"
};
public static double[] GetXValues()
{
return XValues;
}
public static double[][] GetYValues()
{
return YValues;
}
public static string[] GetColumnStyleKeys()
{
return ColumnStyleKeys;
}
public static string[] GetMountainStyleKeys()
{
return MountainStyleKeys;
}
}
}DashboardStyleChartsView.xaml
View source code<UserControl x:Class="SciChart.Examples.Examples.CreateMultiseriesChart.DashboardStyleCharts.DashboardStyleChartsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="clr-namespace:SciChart.Examples.Examples.CreateMultiseriesChart.DashboardStyleCharts"
xmlns:des="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ext="http://schemas.abtsoftware.co.uk/scichart/exampleExternals"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
des:DesignHeight="400"
des:DesignWidth="600"
mc:Ignorable="des">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ExampleListBoxStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<d:SpacingModeToMaximumSpacingConverter x:Key="SpacingModeToMaximumSpacingConverter" />
</ResourceDictionary>
</UserControl.Resources>
<Grid Background="#FF1C1C1E">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- The SciChartInteractionToolbar adds zoom, pan, zoom extents and rotate functionality -->
<!-- to the chart and is included for example purposes. -->
<!-- If you wish to know how to zoom and pan a chart then do a search for Zoom Pan in the Examples suite! -->
<ext:SciChartInteractionToolbar TargetSurface="{Binding Source={x:Reference Name=SciChart}}">
<ext:FlyoutMenuButton Content="ZM" Padding="0" Style="{StaticResource FlyoutMenuButtonStyle}">
<ext:FlyoutMenuButton.PopupContent>
<StackPanel MinWidth="150" Orientation="Vertical">
<TextBlock Text="Zoom Controls" />
<ext:FlyoutSeparator />
<CheckBox Margin="4"
Content="Is Zoom Animated?"
IsChecked="{Binding IsZoomExtendsAnimated, Mode=TwoWay}" />
</StackPanel>
</ext:FlyoutMenuButton.PopupContent>
</ext:FlyoutMenuButton>
<ext:FlyoutMenuButton Content="LBL" Style="{StaticResource FlyoutMenuButtonStyle}">
<ext:FlyoutMenuButton.PopupContent>
<StackPanel MinWidth="150" Orientation="Vertical">
<TextBlock Text="Axis Controls" />
<ext:FlyoutSeparator />
<CheckBox x:Name="ShowLabels"
Margin="4"
Content="ShowLabels?"
IsChecked="True" />
</StackPanel>
</ext:FlyoutMenuButton.PopupContent>
</ext:FlyoutMenuButton>
<ext:FlyoutMenuButton Content="COL" Padding="0" Style="{StaticResource FlyoutMenuButtonStyle}">
<ext:FlyoutMenuButton.PopupContent>
<StackPanel MinWidth="150" Orientation="Vertical">
<TextBlock Text="Column.SpacingMode" />
<ext:FlyoutSeparator />
<ComboBox x:Name="SpacingMode"
MinWidth="75"
Margin="4,0"
ItemsSource="{Binding SpacingModes}"
SelectedIndex="1" />
<TextBlock Margin="4,15,4,4" Text="Column.Spacing" />
<ext:FlyoutSeparator />
<Slider x:Name="Spacing"
Margin="4,0"
Maximum="{Binding ElementName=SpacingMode, Path=SelectedItem,
Converter={StaticResource SpacingModeToMaximumSpacingConverter}}"
Minimum="0.0"
Orientation="Horizontal"
Value="0.2" />
<TextBlock Margin="4,15,4,4" Text="Column.DataPointWidth" />
<ext:FlyoutSeparator />
<Slider x:Name="DataPointWidth"
Margin="4,0"
Maximum="1.0"
Minimum="0.0"
Orientation="Horizontal"
Value="0.8" />
</StackPanel>
</ext:FlyoutMenuButton.PopupContent>
</ext:FlyoutMenuButton>
</ext:SciChartInteractionToolbar>
<DockPanel Grid.Column="1">
<ListBox x:Name="ListBox"
DockPanel.Dock="Top"
ItemsSource="{Binding ChartTypesSource}"
SelectedIndex="{Binding SelectedChartIndex, Mode=TwoWay}"
Style="{StaticResource ExampleListBoxStyle}" />
<!-- Create the chart surface -->
<s:SciChartSurface x:Name="SciChart"
ChartTitle="{Binding CurrentChartType.TypeName}"
Padding="0"
RenderableSeries="{s:SeriesBinding CurrentChartType.RenderableSeriesViewModels}"
ViewportManager="{Binding ViewportManager}">
<s:SciChartSurface.Resources>
<ResourceDictionary Source="RenderebleSeriesStyles.xaml" />
</s:SciChartSurface.Resources>
<!-- Create an X Axis -->
<s:SciChartSurface.XAxis>
<s:NumericAxis AutoTicks="False"
DrawMajorBands="True"
DrawMajorGridLines="False"
DrawMinorGridLines="False"
DrawMinorTicks="False"
MajorDelta="1"
MinimalZoomConstrain="0.1"
MinorDelta="0.5"
VisibleRangeLimit="-1,12" />
</s:SciChartSurface.XAxis>
<!-- Create a Y Axis with GrowBy -->
<s:SciChartSurface.YAxis>
<s:NumericAxis AxisAlignment="Right"
DrawMajorBands="True"
DrawMinorGridLines="False"
DrawMinorTicks="False"
MinimalZoomConstrain="0.1"
TextFormatting="{Binding CurrentChartType.AxisFormatting}" />
</s:SciChartSurface.YAxis>
<s:SciChartSurface.ChartModifier>
<s:ModifierGroup>
<s:RubberBandXyZoomModifier IsAnimated="{Binding IsZoomExtendsAnimated}" IsXAxisOnly="True" />
<s:ZoomPanModifier IsEnabled="False" />
<s:RolloverModifier ShowTooltipOn="Always" UseInterpolation="True" />
<s:ZoomExtentsModifier IsAnimated="{Binding IsZoomExtendsAnimated}" />
<s:MouseWheelZoomModifier />
<s:LegendModifier Margin="10"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
GetLegendDataFor="AllSeries"
LegendPlacement="Bottom"
Orientation="Horizontal"
ShowLegend="True"
ShowVisibilityCheckboxes="True" />
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
</s:SciChartSurface>
</DockPanel>
</Grid>
</UserControl>DashboardStyleChartsView.xaml.cs
View source code// *************************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2022. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// DashboardStyleChartsView.xaml.cs is part of the SCICHART® Examples. Permission is hereby granted
// to modify, create derivative works, distribute and publish any part of this source
// code whether for commercial, private or personal use.
//
// The SCICHART® examples are distributed in the hope that they will be useful, but
// without any warranty. It is provided "AS IS" without warranty of any kind, either
// expressed or implied.
// *************************************************************************************
namespace SciChart.Examples.Examples.CreateMultiseriesChart.DashboardStyleCharts
{
/// <summary>
/// Interaction logic for DashboardStyleCharts.xaml
/// </summary>
public partial class DashboardStyleChartsView
{
public DashboardStyleChartsView()
{
InitializeComponent();
}
}
}DashboardStyleChartsViewModel.cs
View source code// *************************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2022. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// DashboardStyleChartsViewModel.cs is part of the SCICHART® Examples. Permission is hereby granted
// to modify, create derivative works, distribute and publish any part of this source
// code whether for commercial, private or personal use.
//
// The SCICHART® examples are distributed in the hope that they will be useful, but
// without any warranty. It is provided "AS IS" without warranty of any kind, either
// expressed or implied.
// *************************************************************************************
using System;
using System.Collections.Generic;
using SciChart.Charting.ViewportManagers;
using SciChart.Charting.Visuals.RenderableSeries;
using SciChart.Examples.ExternalDependencies.Common;
namespace SciChart.Examples.Examples.CreateMultiseriesChart.DashboardStyleCharts
{
public class DashboardStyleChartsViewModel: BaseViewModel
{
private readonly IViewportManager _viewportManager = new DefaultViewportManager();
private readonly List<ChartTypeViewModel> _chartTypesSource;
private ChartTypeViewModel _currentChartType;
private bool _isZoomExtendsAnimated = true;
private int _selectedChartIndex;
public DashboardStyleChartsViewModel()
{
_chartTypesSource = new List<ChartTypeViewModel>
{
ChartTypeViewModelFactory.New(typeof(IStackedColumnRenderableSeries), false, true),
ChartTypeViewModelFactory.New(typeof(IStackedColumnRenderableSeries), false, false),
ChartTypeViewModelFactory.New(typeof(IStackedColumnRenderableSeries), true, false),
ChartTypeViewModelFactory.New(typeof(IStackedMountainRenderableSeries), false, false),
ChartTypeViewModelFactory.New(typeof(IStackedMountainRenderableSeries), true, false),
};
SpacingModes = new List<SpacingMode> {SpacingMode.Absolute, SpacingMode.Relative};
SelectedChartIndex = 0;
}
public IViewportManager ViewportManager
{
get { return _viewportManager; }
}
public List<SpacingMode> SpacingModes { get; set; }
public List<ChartTypeViewModel> ChartTypesSource
{
get { return _chartTypesSource; }
}
public ChartTypeViewModel CurrentChartType
{
get { return _currentChartType; }
set
{
_currentChartType = value;
OnPropertyChanged("CurrentChartType");
// Invoke AnimateZoomExtents after binding engine has stabilised
_viewportManager.BeginInvoke(() =>
{
var duration = _isZoomExtendsAnimated ? TimeSpan.FromMilliseconds(250) : TimeSpan.FromMilliseconds(0);
_viewportManager.AnimateZoomExtents(duration);
});
}
}
public int SelectedChartIndex
{
get { return _selectedChartIndex; }
set
{
_selectedChartIndex = value;
CurrentChartType = ChartTypesSource[value];
OnPropertyChanged("SelectedChartIndex");
}
}
public bool IsZoomExtendsAnimated
{
get { return _isZoomExtendsAnimated; }
set
{
_isZoomExtendsAnimated = value;
OnPropertyChanged("IsZoomExtendsAnimated");
}
}
}
}ExampleListBoxStyle.xaml
View source code<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="http://schemas.abtsoftware.co.uk/scichart">
<Style x:Key="ExampleListBoxStyle" TargetType="ListBox">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="ListBoxItem">
<Setter Property="Padding" Value="3" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Top" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Grid Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Duration="0"
Storyboard.TargetName="fillColor"
Storyboard.TargetProperty="Opacity"
To=".35" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0"
Storyboard.TargetName="contentPresenter"
Storyboard.TargetProperty="Opacity"
To=".55" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="SelectionStates">
<VisualState x:Name="Unselected" />
<VisualState x:Name="Selected">
<Storyboard>
<DoubleAnimation Duration="0"
Storyboard.TargetName="fillColor2"
Storyboard.TargetProperty="Opacity"
To=".75" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<ObjectAnimationUsingKeyFrames Duration="0"
Storyboard.TargetName="FocusVisualElement"
Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="fillColor"
Fill="#FF0FA32D"
IsHitTestVisible="False"
Opacity="0"
RadiusX="1"
RadiusY="1" />
<Rectangle x:Name="fillColor2"
Fill="#FF0FA32D"
IsHitTestVisible="False"
Opacity="0"
RadiusX="1"
RadiusY="1" />
<ContentPresenter x:Name="contentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
<Rectangle x:Name="FocusVisualElement"
RadiusX="1"
RadiusY="1"
Stroke="#FF0FA32D"
StrokeThickness="1"
Visibility="Collapsed" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<Grid>
<s:SciChartSurface Width="200"
Height="110"
FontSize="12"
FontWeight="SemiBold"
ChartTitle="{Binding TypeName}"
RenderableSeries="{s:SeriesBinding RenderableSeriesViewModels}">
<s:SciChartSurface.Resources>
<ResourceDictionary Source="RenderebleSeriesStyles.xaml" />
</s:SciChartSurface.Resources>
<!-- Create an X Axis -->
<s:SciChartSurface.XAxis>
<s:NumericAxis DrawMajorGridLines="False"
DrawMinorGridLines="False"
Visibility="Collapsed" />
</s:SciChartSurface.XAxis>
<!-- Create a Y Axis with GrowBy -->
<s:SciChartSurface.YAxis>
<s:NumericAxis DrawMajorBands="True"
DrawMajorGridLines="False"
DrawMinorGridLines="False"
Visibility="Collapsed" />
</s:SciChartSurface.YAxis>
</s:SciChartSurface>
<Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border.Background>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="1,0">
<GradientStop Offset="0.0" Color="#00FEFEFE" />
<GradientStop Offset="1.0" Color="#00000000" />
</LinearGradientBrush>
</Border.Background>
</Border>
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>LabelForegroundConverter.cs
View source code// *************************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2022. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// LabelForegroundConverter.cs is part of the SCICHART® Examples. Permission is hereby granted
// to modify, create derivative works, distribute and publish any part of this source
// code whether for commercial, private or personal use.
//
// The SCICHART® examples are distributed in the hope that they will be useful, but
// without any warranty. It is provided "AS IS" without warranty of any kind, either
// expressed or implied.
// *************************************************************************************
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
namespace SciChart.Examples.Examples.CreateMultiseriesChart.DashboardStyleCharts
{
public class LabelForegroundConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var color = (Color) value;
var greyScale = color.R * 0.299 + color.G * 0.587 + color.B * 0.114;
var newColor = greyScale > 128 ? Colors.Black : Colors.White;
return newColor;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}RenderebleSeriesStyles.xaml
View source code<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dashboardStyleCharts="clr-namespace:SciChart.Examples.Examples.CreateMultiseriesChart.DashboardStyleCharts"
xmlns:s="http://schemas.abtsoftware.co.uk/scichart">
<dashboardStyleCharts:LabelForegroundConverter x:Key="LabelForegroundConverter" />
<Style x:Key="BaseStackedStyle" TargetType="s:StackedColumnRenderableSeries">
<Setter Property="LabelColor" Value="{Binding Stroke, RelativeSource={RelativeSource Self}, Converter={StaticResource LabelForegroundConverter}}" />
<Setter Property="ShowLabel" Value="{Binding IsChecked, ElementName=ShowLabels, Mode=TwoWay}" />
<Setter Property="DataPointWidth" Value="{Binding Value, ElementName=DataPointWidth, Mode=TwoWay}" />
<Setter Property="Spacing" Value="{Binding Value, ElementName=Spacing, Mode=TwoWay}" />
<Setter Property="SpacingMode" Value="{Binding SelectedItem, ElementName=SpacingMode, Mode=TwoWay}" />
</Style>
<Style x:Key="StackedColumnBlueStyle"
BasedOn="{StaticResource BaseStackedStyle}"
TargetType="s:StackedColumnRenderableSeries">
<Setter Property="Stroke" Value="#ff226fb7" />
<Setter Property="Fill">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Offset="0.0" Color="#ff226fb7" />
<GradientStop Offset="1.0" Color="#ff1b5790" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StackedColumnOrangeStyle"
BasedOn="{StaticResource BaseStackedStyle}"
TargetType="s:StackedColumnRenderableSeries">
<Setter Property="Stroke" Value="#ffff9a2e" />
<Setter Property="Fill">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Offset="0.0" Color="#ffff9a2e" />
<GradientStop Offset="1.0" Color="#ffd27f26" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StackedColumnRedStyle"
BasedOn="{StaticResource BaseStackedStyle}"
TargetType="s:StackedColumnRenderableSeries">
<Setter Property="Stroke" Value="#ffdc443f" />
<Setter Property="Fill">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Offset="0.0" Color="#ffdc443f" />
<GradientStop Offset="1.0" Color="#ffbd3a36" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StackedColumnGreenStyle"
BasedOn="{StaticResource BaseStackedStyle}"
TargetType="s:StackedColumnRenderableSeries">
<Setter Property="Stroke" Value="#ffaad34f" />
<Setter Property="Fill">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Offset="0.0" Color="#ffaad34f" />
<GradientStop Offset="1.0" Color="#ff91b443" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StackedColumnVioletStyle"
BasedOn="{StaticResource BaseStackedStyle}"
TargetType="s:StackedColumnRenderableSeries">
<Setter Property="Stroke" Value="#ff8562b4" />
<Setter Property="Fill">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Offset="0.0" Color="#ff8562b4" />
<GradientStop Offset="1.0" Color="#ff664b8a" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StackedMountainBlueStyle" TargetType="s:StackedMountainRenderableSeries">
<Setter Property="Stroke" Value="#ff226fb7" />
<Setter Property="Fill">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Offset="0.0" Color="#ff226fb7" />
<GradientStop Offset="1.0" Color="#ff1b5790" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StackedMountainOrangeStyle" TargetType="s:StackedMountainRenderableSeries">
<Setter Property="Stroke" Value="#ffff9a2e" />
<Setter Property="Fill">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Offset="0.0" Color="#ffff9a2e" />
<GradientStop Offset="1.0" Color="#ffd27f26" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StackedMountainRedStyle" TargetType="s:StackedMountainRenderableSeries">
<Setter Property="Stroke" Value="#ffdc443f" />
<Setter Property="Fill">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Offset="0.0" Color="#ffdc443f" />
<GradientStop Offset="1.0" Color="#ffbd3a36" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StackedMountainGreenStyle" TargetType="s:StackedMountainRenderableSeries">
<Setter Property="Stroke" Value="#ffaad34f" />
<Setter Property="Fill">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Offset="0.0" Color="#ffaad34f" />
<GradientStop Offset="1.0" Color="#ff91b443" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StackedMountainVioletStyle" TargetType="s:StackedMountainRenderableSeries">
<Setter Property="Stroke" Value="#ff8562b4" />
<Setter Property="Fill">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Offset="0.0" Color="#ff8562b4" />
<GradientStop Offset="1.0" Color="#ff664b8a" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>SpacingModeToMaximumSpacingConverter.cs
View source codeBack to WPF Chart Examples


