Hi,
How Can I format tooltip value?
I'm using this template for series1 of my datachart:
var tooltipTemplate = "<div class=''><div style='font-weight:bold;'>${item." + asseX + "}</div><div>Valore: <label class='bold'>${item." + asseY + "}</label></div></div>";
I formatted label using javascript .toLocaleString(); to have dot and comma in my value.
Hello Francesco,
You are able to modify the tooltip value through the tooltipShowing event.
If you have further questions, please contact us again.
Best regardsAleksandar KamenovSoftware DeveloperInfragistics Inc.
I have a datachart with different series.
tooltipShowing: function (evt, ui) { ui.item[asseY].toLocaleString();
ui.item[asseY2].toLocaleString(); },
I tried to format my series but it doesn't work.
I am also trying to use the tooltipShowing to modify the tooltip.
I am doing the following. A valid HTML string is returned to tooltip, however, the chart tooltip is still the default tooltip rather than my modified tooltip:
tooltipShowing: function (evt, ui) {// Programmatically set the tooltip var tooltip = GetChartTooltip(ui); if (tooltip != '') { ui.element.tooltip().text(tooltip); } }
As you can see from the documentation the access to the tooltip is provided through ui.element.
So in order to take the value of the particular tooltip you would need to access it with the following snippet: ui.element.tooltip().text();
Or if you would like to change the text: ui.element.tooltip().text('your text');