Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
150618 | Jan 13,2020 03:42 PM UTC | Jan 14,2020 08:55 AM UTC | WPF | 1 |
![]() |
Tags: SfChart |
<local:SfChartExt x:Name="chart" >
<syncfusion:CategoryAxis Header="My header text" >
<syncfusion:CategoryAxis.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Width="{Binding ElementName=primaryAxis, Path=ActualWidth}" TextAlignment="Center" FontSize="{Binding Path=Value, ElementName=slider}" />
</DataTemplate>
</syncfusion:CategoryAxis.HeaderTemplate>
</local:SfChartExt>
|
public class SfChartExt : SfChart
{
protected override Size ArrangeOverride(Size arrangeBounds)
{
var size = base.ArrangeOverride(arrangeBounds);
// Positioning the Primary Axis.
ContentControl xAxisHeader = PrimaryAxis.GetType().GetField("headerContent",
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(PrimaryAxis) as ContentControl;
Canvas.SetLeft(xAxisHeader, 0);
// Positioning the Secondary Axis.
ContentControl yAxisHeader = SecondaryAxis.GetType().GetField("headerContent",
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(SecondaryAxis) as ContentControl;
Canvas.SetLeft(yAxisHeader, -(SecondaryAxis.DesiredSize.Height - yAxisHeader.DesiredSize.Height) / 2);
return size;
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.