We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Display multiple tooltips based on maximum and minimum of data

Thread ID:

Created:

Updated:

Platform:

Replies:

147422 Sep 10,2019 09:29 AM UTC Sep 11,2019 09:56 AM UTC Xamarin.Forms 1
loading
Tags: SfChart
Daniel
Asked On September 10, 2019 09:29 AM UTC

Background: I have a chart with a data source. This chart has a tooltip enabled so that when a user presses one of the points (line, bar, etc), the tooltip shows.

Question: Can I have two tooltips hovering over the minimum and maximum values of the data? I have these values, but I would like a tooltip for both at the same time on the chart indicating them to the user.

Additionally, I would like the user to be able to press one of the points on the chart and the min/max tooltips to go away, and reappear when the user’s choice times out. I understand that this will involve working with the OnClick event or whatever it’s called.

Thanks in advance.


Muneesh Kumar G [Syncfusion]
Replied On September 11, 2019 09:56 AM UTC

Hi Daniel, 
 
Greetings from Syncfusion.  
 
Query 1: Can I have two tooltips hovering over the minimum and maximum values of the data? I have these values, but I would like a tooltip for both at the same time on the chart indicating them to the user. 
 
We have analyzed your requirement and if you want to show the two values for the single series means, you can achieve this by using the TooltipTemplate property which is available in ChartSeries. Please refer the below code. 
 
Code snippet[XAML]: 
<DataTemplate x:Key="template"> 
    <StackLayout Orientation="Vertical"> 
        <StackLayout Orientation="Horizontal"> 
            <Label Text="Minimum :" /> 
            <Label Text="{Binding Value1}"/> 
        </StackLayout> 
        <StackLayout Orientation="Horizontal"> 
            <Label Text="Maximum :" /> 
            <Label Text="{Binding Value2}"/> 
        </StackLayout> 
    </StackLayout> 
</DataTemplate> 
 
-      - 
<chart:LineSeries ItemsSource="{Binding LineData1}" XBindingPath="XValue" YBindingPath="Value1" EnableTooltip="True" TooltipTemplate="{StaticResource template}"> 
</chart:LineSeries> 
 
Note – The BindingContext for the tooltip data template will be the respective underlying object from ItemsSource. So, you can bind the values only if it is present in that model. 
 
 
Or if your requirement is to show the data point for all the YValues present in the same XValue, you have to use the TrackballBehavior. Please refer the below code. 
 
Code snippet[XAML]: 
<chart:SfChart.ChartBehaviors> 
    <chart:ChartTrackballBehavior ShowLine="False" /> 
</chart:SfChart.ChartBehaviors> 
 
 
Query 2:  I would like the user to be able to press one of the points on the chart and the min/max tooltips to go away, and reappear when the user’s choice times out. 
 
You can achieve this by using the Hide and Show methods of TooltipBehavior. Please refer the below code. 
 
Code snippet [C#]: 
tooltipBehavior.Show(pointX, pointY, true); 
 
-     -  
 
tooltip.Hide(true); 
 
Please refer the below UG for more details: 
 
 
If the above solution not fulfilled your requirement. Please share the image you want to achieve. This would be helpful for us to provide you a better solution at the earliest. 
  
Thanks, 
Muneesh Kumar G. 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon