Hi Ditchford,
Greetings from Syncfusion.
We suggest you to sepcify tooltip format as ${point.percentage}
to display percentage value for accumulation chart and TooltipRender
event to customize the chart series tooltip text. We have prepared sample based
on your requirement. Please check with below snippet and sample.
<SfChart>
<ChartEvents TooltipRender="OnTooltipRender"></ChartEvents>
<ChartTooltipSettings Enable=true></ChartTooltipSettings>
</SfChart>
<SfAccumulationChart>
<AccumulationChartTooltipSettings
Format="${point.percentage}%">
</AccumulationChartTooltipSettings>
</SfAccumulationChart>
@code {
public double totalSum = 0;
protected override void
OnInitialized()
{
for (int i = 0; i <
MedalDetails.Count; i++)
{
totalSum = totalSum + Convert.ToInt16(MedalDetails[i].YValue);
}
}
public void
OnTooltipRender(TooltipRenderEventArgs args)
{
var percentage = (Convert.ToDouble(args.Data.PointY) / totalSum) * 100;
args.Text = Math.Round(percentage, 2) + "%";
}}
|
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/TooltipPerc-83147131.zip
Kindly revert us if you have any concerns.
Regards,
Durga Gopalakrishnan.