Articles in this section
Category / Section

How to Hide the Tooltip when Focus is Moved from Blazor Charts?

4 mins read

This article explains how to hide the tooltip immediately when focus is moved away from a chart in Blazor Charts.

Hide the Tooltip Immediately When Focus is Moved Away from a Chart

Blazor Charts provides an option to hide the tooltip immediately when focus is moved away from a chart. This can be achieved by setting the FadeOutDuration to 0 to hide the tooltip immediately when focus is moved away from a chart.

The below code example demonstrates how to hide the tooltip immediately when focus is moved away from a chart.

Index.razor

@using Syncfusion.Blazor.Charts

<SfChart>
   <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>

   <ChartSeriesCollection>
       <ChartSeries DataSource="@MedalDetails" Name="Legend1" XName="X" YName="YValue" Type="Syncfusion.Blazor.Charts.ChartSeriesType.StackingColumn">
       </ChartSeries>
       <ChartSeries DataSource="@MedalDetails" Name="Legend2" XName="X" YName="YValue1" Type="Syncfusion.Blazor.Charts.ChartSeriesType.StackingColumn">
       </ChartSeries>
       <ChartSeries DataSource="@MedalDetails" Name="Legend3" XName="X" YName="YValue2" Type="Syncfusion.Blazor.Charts.ChartSeriesType.StackingColumn">
       </ChartSeries>
       <ChartSeries DataSource="@MedalDetails" Name="Legend4" XName="X" YName="YValue3" Type="Syncfusion.Blazor.Charts.ChartSeriesType.StackingColumn">
       </ChartSeries>
   </ChartSeriesCollection>

   <ChartLegendSettings Visible="true" EnableHighlight="true" />
   <ChartTooltipSettings FadeOutDuration="0" Enable="true" Shared="true" />
</SfChart>

@code {
   public class ChartData
   {
       public string X { get; set; }
       public double YValue { get; set; }
       public double YValue1 { get; set; }
       public double YValue2 { get; set; }
       public double YValue3 { get; set; }
   }


   public List<ChartData> MedalDetails = new List<ChartData>
   {
       new ChartData { X= "Jan", YValue= 10, YValue1= 20, YValue2= 30, YValue3= 40 },
       new ChartData { X= "Feb", YValue= 20, YValue1= 30, YValue2= 40, YValue3= 50 },
       new ChartData { X= "Mar", YValue= 30, YValue1= 40, YValue2= 50, YValue3= 60 },
       new ChartData { X= "Apr", YValue= 40, YValue1= 50, YValue2= 60, YValue3= 70 },
       new ChartData { X= "May", YValue= 50, YValue1= 60, YValue2= 70, YValue3= 80 },
       new ChartData { X= "Jun", YValue= 60, YValue1= 70, YValue2= 80, YValue3= 90 },
       new ChartData { X= "Jul", YValue= 70, YValue1= 80, YValue2= 90, YValue3= 100 },
       new ChartData { X= "Aug", YValue= 80, YValue1= 90, YValue2= 100, YValue3= 110 },
       new ChartData { X= "Sep", YValue= 90, YValue1= 100, YValue2= 110, YValue3= 120 },
       new ChartData { X= "Oct", YValue= 100, YValue1= 110, YValue2= 120, YValue3= 130 },
       new ChartData { X= "Nov", YValue= 110, YValue1= 120, YValue2= 130, YValue3= 140 },
       new ChartData { X= "Dec", YValue= 120, YValue1= 130, YValue2= 140, YValue3= 150 },
   };
} 

The following GIF illustrates the output of the code snippet.

chrome_RVNmEUmQoU.gif

Live Sample for Hiding the Tooltip Immediately When Focus is Moved Away from a Chart

Conclusion

I hope you enjoyed learning how to hide the tooltip when focus is moved from Blazor Charts.

You can refer to our Blazor Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our Blazor Chart example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied