|
<chart:SfChart.Axes>
<chart:NumericalAxis IsVisible="True" OpposedPosition="True" LabelExtent="200" IsVertical="True">
<chart:NumericalAxis.LabelStyle>
<chart:ChartAxisLabelStyle TextColor="Transparent" />
</chart:NumericalAxis.LabelStyle>
<chart:NumericalAxis.MinorTickStyle>
<chart:ChartAxisTickStyle StrokeWidth="0" StrokeColor="Transparent" TickSize="0"/>
</chart:NumericalAxis.MinorTickStyle>
<chart:NumericalAxis.AxisLineStyle>
<chart:ChartLineStyle StrokeColor="Transparent" />
</chart:NumericalAxis.AxisLineStyle>
</chart:NumericalAxis>
</chart:SfChart.Axes> |
|
ViewAnnotation view = new ViewAnnotation();
view.View = new Label() { Text = "Hello"};
view.HorizontalAlignment = ChartAnnotationAlignment.End;
view.CoordinateUnit = ChartCoordinateUnit.Pixels;
sfChart.ChartAnnotations.Add(view);
private void sfChart_SeriesRendered(object sender, EventArgs e)
{
sfChart.ChartAnnotations[0].X1 = sfChart.ValueToPoint(sfChart.PrimaryAxis, 11);
sfChart.ChartAnnotations[0].Y1 = sfChart.ValueToPoint(sfChart.SecondaryAxis, 5);
} |
|
private void sfChart_SeriesRendered(object sender, EventArgs e)
{
if (sfChart.Series[0].ItemsSource != null)
{
sfChart.ChartAnnotations[0].X1 = sfChart.ValueToPoint(sfChart.PrimaryAxis, 10.5);
sfChart.ChartAnnotations[0].Y1 = sfChart.ValueToPoint(sfChart.SecondaryAxis, 5);
}
}
protected override void OnSizeAllocated(double width, double height)
{
base.OnSizeAllocated(width, height);
var data = lineSeries.ItemsSource;
lineSeries.ItemsSource = null;
lineSeries.ItemsSource = data;
} |