<chart:SfChart.ChartAnnotations>
<chart:TextAnnotation x:Name="textAnnotation" Text="Some Label"
CoordinateUnit="Pixels">
<chart:TextAnnotation.LabelStyle>
<chart:ChartAnnotationLabelStyle
HorizontalTextAlignment="End" VerticalTextAlignment="Center">
</chart:ChartAnnotationLabelStyle>
</chart:TextAnnotation.LabelStyle>
</chart:TextAnnotation>
</chart:SfChart.ChartAnnotations>
|
private void SecondaryAxis_ActualRangeChanged(object sender, ActualRangeChangedEventArgs e)
{
textAnnotation.Y1 = chart1.ValueToPoint(secondaryAxis,
(double)e.ActualMinimum)+ 80;
}
private void PrimaryAxis_ActualRangeChanged(object sender, ActualRangeChangedEventArgs e)
{
textAnnotation.X1 = chart1.ValueToPoint(primaryAxis,
(double)e.ActualMinimum);
}
|