Thousands Separator in ToolTip

How do I get a decimal value in a tooltip to show the thousands separator?  Right now it just shows the currency value with no comma.  


3 Replies

GV Gopalakrishnan Veeraraghavan Syncfusion Team May 22, 2023 04:08 PM UTC

Hi George,


We have analyzed your query. We suggest rendering the tooltip's Y value with a separator by utilizing the TooltipRender event to modify the Y value accordingly. We have attached a sample and screenshot for your reference. Please check with the below code snippet.


<ChartEvents TooltipRender="TooltipEvent"></ChartEvents>


  public void TooltipEvent(TooltipRenderEventArgs args)

  {

        string[] split = args.Text.Split("<b>");

        string[] split2 = split[1].Split("</b>");

        args.Text = split[0] + "<b>" + double.Parse(split2[0], culture).ToString("N0", culture) + "</b>";

  }


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ThousandSeparator-512875282.zip


Screenshot:

A picture containing line, diagram, plot

Description automatically generated


Kindly revert us if you have any concerns.



Regards,

Gopalakrishnan Veeraraghavan



AR Arthur Robinson August 9, 2024 02:50 PM UTC



DG Durga Gopalakrishnan Syncfusion Team August 12, 2024 12:17 PM UTC

Hi Arthur,


Yes, you can use UseGroupingSeparator property itself to display chart series tooltip with comma. We have attached the modified sample with latest version for your reference.


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


If you have any further questions or need additional assistance, please feel free to reach out.


Regards,

Durga Gopalakrishnan.


Loader.
Up arrow icon