tooltip on stack bar 100 is not centered

Here is my code for char tooltip settings. I would like to center text of data.Y, but without success.


 <ChartTooltipSettings Enable="true" >

     <Template>

         @{

             var data = context as ChartTooltipInfo;

             <div style="width:100%;">

                 <div style="display:flex; background-color: DodgerBlue;justify-content:center;">

                     <div>@data.Y </div>

                 </div>

             </div>

         }

     </Template>

     </ChartTooltipSettings>


Attachment: Screenshot_20241114_170503_a9532b37.rar

1 Reply

DG Durga Gopalakrishnan Syncfusion Team November 18, 2024 01:33 PM UTC

Hi Praveen,


We have analyzed your requirement. By default, for column-type charts, the tooltip is displayed at the top of the column rectangle. However, when the tooltip template is enabled for the chart, it appears slightly higher. Could you confirm if you are mentioning this behavior as an issue and if you need the tooltip template to align like the default tooltip's position? If so, please share a screenshot indicating the exact position where you would like the tooltip template to appear.


For your reference, we have shared examples of both default and template tooltips.


Sample : https://blazorplayground.syncfusion.com/BXhJsiWlKczEpZbN


Online Demo : https://blazor.syncfusion.com/demos/chart/percent-stacked-bar?theme=fluent2


Please let us know if you have any concerns.


Regards,

Durga Gopalakrishnan.


Loader.
Up arrow icon