Hi
I tried to create a Custom DataMarker in c# code according to the syncfusion documetation
var series = new FastLineSeries();
...
series.DataMarker = new ChartDataMarker();
series.DataMarker.ShowLabel = true;
series.DataMarker.LabelStyle.LabelPosition = DataMarkerLabelPosition.Outer;
DataTemplate dataMarkerTemplate = new DataTemplate(() =>
{
StackLayout stack = new StackLayout();
stack.Orientation = StackOrientation.Horizontal;
Label label = new Label();
label.SetBinding(Label.TextProperty, "Value");
label.FontSize = 15;
label.VerticalOptions = LayoutOptions.Center;
//Image image = new Image();
//image.Source = "Down.jpg";
//image.WidthRequest = 30;
//image.HeightRequest = 30;
stack.Children.Add(label);
//stack.Children.Add(image);
return stack;
});
series.DataMarker.LabelTemplate = dataMarkerTemplate;
chart.Series.Add(series);
As soon as I add the code line series.DataMarker.LabelTemplate = dataMarkerTemplate;
markers aren't Shown anymore, when I remove everything is ok
What is wrong with my code?
Environment:
Visual Studio 2017
Syncfusioan SfChart 16.3.0.21
Xamarin.Forms 3.1.0.697729
.net Standard 2.0.3
Thanks Gunter