From: Shermin Ismail
Sent: Monday, February 19, 2018 12:13 AM
To: Syncfusion Support <[email protected]>
Subject: RE: Syncfusion support community forum 135889, Custom tooltip, has been updated.
Hi,
If you want to provide same name for tooltip template labels text . How will we add that.
series1.ItemsSource = sessionsLPG;
series1.XBindingPath = "LiftingDate";
series1.YBindingPath = "liftingkgs";
seriesCond.BindingContext = sessionsCond;
seriesCond.ItemsSource = sessionsCond;
seriesCond.XBindingPath = "LiftingDate";
seriesCond.YBindingPath = "liftingkgs";
DataTemplate templateNGLVolume = new DataTemplate(() =>
{
StackLayout container = new StackLayout() { Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand };
container.BackgroundColor = Color.White;
StackLayout stack = new StackLayout() { Orientation = StackOrientation.Horizontal };
stack.BackgroundColor = Color.White;
stack.HorizontalOptions = LayoutOptions.Center;
Label label = new Label() { Text = "XValue:" };
Label xValue = new Label();
xValue.FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label));
xValue.SetBinding(Label.TextProperty, new Binding("LiftingDate", stringFormat: "{0:dd-MMM}"));
stack.Children.Add(xValue);
StackLayout stack1 = new StackLayout() { Orientation = StackOrientation.Horizontal, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand };
stack1.BackgroundColor = Color.White;
Label yValue = new Label();
yValue.FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label));
yValue.SetBinding(Label.TextProperty, new Binding("liftingkgs", stringFormat: "Cond:{0}"));
Label yValueCond = new Label();
yValueCond.FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label));
//
yValueCond.SetBinding(Label.TextProperty, new Binding("liftingkgs", stringFormat: "Lpg:{0}"));
stack1.Children.Add(yValueCond);
stack1.Children.Add(yValue);
container.Children.Add(stack);
container.Children.Add(stack1);
return container;
});
seriesCond.TooltipTemplate = templateNGLVolume;
In this case, two label gives the same value. How to provide two different values. One is COND and one is LPG based values.But in tooltip template, same values are coming in template.
Can you please provide a solution.