I made two Charts. In both of them is one single linechart. They have different values on the x- and y-axis. But I want to show them both at the same time. So I have to make the background and axis of the second chart transparent. Only the line should stay visible, so that I can see it in the first chart. It doesen´t matter that the axis aren´t then correct anymore for the second chart .
This is how it should look like when both charts are visible:
And this is the XAML I already coded. How can I change the background and axis to transparent or hidden?:
<chartingToolkit:Chart Background="White" BorderThickness="0">
<chartingToolkit:LineSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding DemandPrice}" IsSelectionEnabled="True" Visibility="{Binding TodayVisible}">
<chartingToolkit:LineSeries.Style>
<Style TargetType="chartingToolkit:LineSeries" BasedOn="{StaticResource {x:Type chartingToolkit:LineSeries}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="chartingToolkit:LineSeries">
<Canvas x:Name="PlotArea">
<Polyline x:Name="polyline"
Points="{TemplateBinding Points}"
Style="{TemplateBinding PolylineStyle}"
StrokeThickness="4" >
<Polyline.Stroke>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Gray" Offset="0"/>
<GradientStop Color="Gray" Offset="1"/>
</LinearGradientBrush>
</Polyline.Stroke>
</Polyline>
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</chartingToolkit:LineSeries.Style>
<chartingToolkit:LineSeries.DataPointStyle>
<Style TargetType="chartingToolkit:LineDataPoint">
<Setter Property="Background" Value="Transparent" />
</Style>
</chartingToolkit:LineSeries.DataPointStyle>
</chartingToolkit:LineSeries>
</chartingToolkit:Chart>
<chartingToolkit:Chart Background="Transparent" BorderThickness="0">
<!-- EEX Price-->
<chartingToolkit:LineSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding EEXPrice}" IsSelectionEnabled="True" Background="{StaticResource AccentColorBrush}" Visibility="{Binding EEXVisible}">
<chartingToolkit:LineSeries.Style>
<Style TargetType="chartingToolkit:LineSeries" BasedOn="{StaticResource {x:Type chartingToolkit:LineSeries}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="chartingToolkit:LineSeries">
<Canvas x:Name="PlotArea">
<Border
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0">
</Border>
<Polyline x:Name="polyline"
Points="{TemplateBinding Points}"
Style="{TemplateBinding PolylineStyle}"
StrokeThickness="4">
<Polyline.Stroke>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Blue" Offset="0"/>
<GradientStop Color="Blue" Offset="1"/>
</LinearGradientBrush>
</Polyline.Stroke>
</Polyline>
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</chartingToolkit:LineSeries.Style>
<chartingToolkit:LineSeries.DataPointStyle>
<Style TargetType="chartingToolkit:LineDataPoint">
<Setter Property="Background" Value="Transparent" />
</Style>
</chartingToolkit:LineSeries.DataPointStyle>
</chartingToolkit:LineSeries>
<chartingToolkit:Chart.LegendStyle>
<Style TargetType="datavis:Legend">
<Setter Property="Width" Value="0" />
</Style>
</chartingToolkit:Chart.LegendStyle>
</chartingToolkit:Chart>