How to remove space between chart area and plot area?
- by Gopalakrishnan Subramani
I am using chartingToolKit:Chart control. I want to remove the white space appear in between the chart and plot area. Attached the WPF sample and image of area to be removed.
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit">
<Grid>
<chartingToolkit:Chart x:Name="chart" Width="500" Height="300" Margin="0, 0, 0, 0" LegendStyle="{StaticResource LegendStyle}" >
<chartingToolkit:AreaSeries ItemsSource="{Binding}"
DependentValuePath="Value"
IndependentValuePath="Key"
Background="Red"
>
</chartingToolkit:AreaSeries>
<chartingToolkit:Chart.Axes>
<chartingToolkit:LinearAxis Orientation="X" ShowGridLines="False" Visibility="Hidden">
</chartingToolkit:LinearAxis>
<chartingToolkit:LinearAxis Orientation="Y" ShowGridLines="False" Visibility="Hidden"/>
</chartingToolkit:Chart.Axes>
</chartingToolkit:Chart>
</Grid>
The area marked in red arrow must be removed