dataTemplate = new DataTemplate(() =>
{
VerticalStackLayout mainlayout = new VerticalStackLayout();
mainlayout.BackgroundColor =
Colors.Black;
HorizontalStackLayout yearLayout = new
HorizontalStackLayout();
yearLayout.BackgroundColor =
Colors.Black;
Label yearLabel = new Label() { Padding = 2,
FontSize = 10, TextColor = Colors.White, Text = "Year:" };
Label year = new Label() { Padding = 2,
FontSize = 10, TextColor = Colors.White};
year.SetBinding(Label.TextProperty, "Item.Year");
yearLayout.Add(yearLabel);
yearLayout.Add(year);
HorizontalStackLayout revenueLayout = new
HorizontalStackLayout();
revenueLayout.BackgroundColor =
Colors.Black;
Label revenueLabel = new Label() { Padding = 2,
FontSize = 10, TextColor = Colors.White, Text = "Revenue:" };
Label revenue = new Label() { Padding = 2,
FontSize = 10, TextColor = Colors.White };
revenue.SetBinding(Label.TextProperty, "Item.Revenue", stringFormat: "{0}$");
revenueLayout.Add(revenueLabel);
revenueLayout.Add(revenue);
mainlayout.Add(yearLayout);
mainlayout.Add(revenueLayout);
return mainlayout;
});
areaSeries.TooltipTemplate
= dataTemplate;
|