Hi,
I'am trying to position the Chart Titles into the ChartPlotArea.
That's all well and good, but if i'm setting the Background Color of the PlotArea differently than the Background of the ChartArea the PlotArea hides the ChartTitle.
Setting a ZIndex for the PlotArea and the Title dosn't work.
Here is my Code:
I would like to display the AxisTitle above the PlotArea and above any MarkedZones. Is there any solution?
Best regards
Dominik
I'am trying to position the Chart Titles into the ChartPlotArea.
That's all well and good, but if i'm setting the Background Color of the PlotArea differently than the Background of the ChartArea the PlotArea hides the ChartTitle.
Setting a ZIndex for the PlotArea and the Title dosn't work.
Picture without setting a special background color
Picture with setting a special background color
Here is my Code:
<UserControl.Resources>
<Style x:Key=
"XTitleStyle"
TargetType=
"{x:Type telerik:AxisTitle}"
>
<Setter Property=
"Margin"
Value=
"0,-32,1,0"
/>
<Setter Property=
"HorizontalAlignment"
Value=
"Right"
/>
<Setter Property=
"Panel.ZIndex"
Value=
"10"
/>
</Style>
<Style x:Key=
"Y1TitleStyle"
TargetType=
"{x:Type telerik:AxisTitle}"
>
<Setter Property=
"VerticalAlignment"
Value=
"Top"
/>
<Setter Property=
"RenderTransform"
>
<Setter.Value>
<TransformGroup>
<TranslateTransform X=
"-5"
Y=
"-80"
/>
<RotateTransform Angle=
"90"
/>
</TransformGroup>
</Setter.Value>
</Setter>
</Style>
<Style TargetType=
"{x:Type telerik:MarkedZone}"
>
<Setter Property=
"Panel.ZIndex"
Value=
"-1"
/>
</Style>
</UserControl.Resources>
<Grid Width=
"Auto"
Height=
"Auto"
>
<telerik:RadChart HorizontalAlignment=
"Stretch"
Margin=
"10,5,10,5"
Name=
"radChart1"
VerticalAlignment=
"Stretch"
BorderThickness=
"0"
Background=
"{DynamicResource backgroundTabControl}"
>
<telerik:RadChart.SeriesMappings>
<telerik:SeriesMapping ItemsSource=
"{Binding Series1, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
>
<telerik:SeriesMapping.SeriesDefinition>
<telerik:LineSeriesDefinition ShowItemLabels=
"False"
ShowPointMarks=
"False"
>
<telerik:LineSeriesDefinition.Appearance>
<telerik:SeriesAppearanceSettings StrokeThickness=
"1.5"
/>
</telerik:LineSeriesDefinition.Appearance>
</telerik:LineSeriesDefinition>
</telerik:SeriesMapping.SeriesDefinition>
<telerik:SeriesMapping.ItemMappings>
<telerik:ItemMapping FieldName=
"Y"
DataPointMember=
"YValue"
/>
</telerik:SeriesMapping.ItemMappings>
</telerik:SeriesMapping>
</telerik:RadChart.SeriesMappings>
<telerik:RadChart.DefaultView>
<telerik:ChartDefaultView ChartLegend=
"{x:Null}"
>
<telerik:ChartDefaultView.ChartArea>
<telerik:ChartArea EnableAnimations=
"False"
EnableStripLinesAnimation=
"False"
SnapsToDevicePixels=
"True"
>
<!-- Here I'm setting the Background with PlotAreaStyle-->
<telerik:ChartArea.PlotAreaStyle>
<Style TargetType=
"{x:Type telerik:ClipPanel}"
>
<Setter Property=
"Background"
Value=
"White"
/>
<Setter Property=
"Panel.ZIndex"
Value=
"-1"
/>
</Style>
</telerik:ChartArea.PlotAreaStyle>
<!-- Here I'm setting the Background with a MarkedZone-->
<telerik:ChartArea.Annotations>
<telerik:MarkedZone Background=
"White"
/>
</telerik:ChartArea.Annotations>
<telerik:ChartArea.AxisX>
<telerik:AxisX AutoRange=
"False"
MajorGridLinesVisibility=
"Visible"
MajorTicksVisibility=
"Visible"
Title=
"test"
>
<telerik:AxisX.AxisStyles>
<telerik:AxisStyles TitleStyle=
"{StaticResource XTitleStyle}"
/>
</telerik:AxisX.AxisStyles>
</telerik:AxisX>
</telerik:ChartArea.AxisX>
<telerik:ChartArea.AxisY>
<telerik:AxisY AutoRange=
"False"
MajorGridLinesVisibility=
"Visible"
MinorGridLinesVisibility=
"Collapsed"
Title=
"test"
PlotAreaAxisVisibility=
"Visible"
StripLinesVisibility=
"Collapsed"
>
<telerik:AxisY.AxisStyles>
<telerik:AxisStyles TitleStyle=
"{StaticResource Y1TitleStyle}"
/>
</telerik:AxisY.AxisStyles>
</telerik:AxisY>
</telerik:ChartArea.AxisY>
</telerik:ChartArea>
</telerik:ChartDefaultView.ChartArea>
</telerik:ChartDefaultView>
</telerik:RadChart.DefaultView>
</telerik:RadChart>
</Grid>
I would like to display the AxisTitle above the PlotArea and above any MarkedZones. Is there any solution?
Best regards
Dominik