SfAccumulationChart Format Tooltip

Hi,

I would like to format the tooltip, something like this 
Format="${point.x}: <b>${point.y:N2}</b>"

Is that possible?

Attached the full xaml.
Thanks and regards
Michael


  <SfAccumulationChart @ref="_chartPie" EnableAnimation="true" Background="#f1f1f1" Width="100%" Height="100%">
      <AccumulationChartTooltipSettings Enable="true" Format="${point.x}: <b>${point.y:N2}</b>"></AccumulationChartTooltipSettings>
      <AccumulationChartLegendSettings Visible="true"></AccumulationChartLegendSettings>
      <AccumulationChartSeriesCollection>
        <AccumulationChartSeries DataSource="_chartData" XName="Text" YName="Value" Name="Info" StartAngle="0" EndAngle="360" Radius="70%" InnerRadius="0%" Explode="true">
          <AccumulationDataLabelSettings Visible="true" Name="Text" Position="AccumulationLabelPosition.Outside">
            <AccumulationChartDataLabelFont FontWeight="600"></AccumulationChartDataLabelFont>
          </AccumulationDataLabelSettings>
        </AccumulationChartSeries>
      </AccumulationChartSeriesCollection>
    </SfAccumulationChart>

3 Replies

SM Srihari Muthukaruppan Syncfusion Team May 19, 2020 12:44 PM UTC

Hi Michael,

We have analyzed your query. From that, we would like to let you know that we can achieve your requirement using TooltipRender event in the chart based on your requirement we have prepared a sample for your reference. Please find the sample, code snippet, and screenshot below.


Code Snippet: 
  
 
    <SfAccumulationChart EnableAnimation="true" Background="#f1f1f1" Width="100%" Height="100%">
        <AccumulationChartEvents TooltipRender="TooltipRender" />
        <AccumulationChartTooltipSettings Enable="true" Format="${point.x}: ${point.y}">         </AccumulationChartTooltipSettings>
    // add additional code here
    </SfAccumulationChart>

 
@code {
// add additional code here
    void TooltipRender(ITooltipRenderEventArgs Args)
    {
        var text = Args.Text.Split(':');
        var pointX = text[0];
        var y = Int32.Parse(text[1]);
        var pointY = y.ToString("0.00");
        Args.Text = pointX + " : " + pointY;
    }
}

Screenshot:
 
 

Let us know if you have any concerns. 
  
Regards, 
Srihari M 



MS Michael Sandler May 19, 2020 01:14 PM UTC

Thanks for the fast solution. Working like expected.

Thanks and regards
Michael


SM Srihari Muthukaruppan Syncfusion Team May 20, 2020 06:23 AM UTC

Hi Michael,  
  
Most welcome. Kindly get in touch with us, if you would require further assistance. We are always happy in assisting you.   
   
Thanks,   
Srihari M 


Loader.
Up arrow icon