KoExtensions icon indicating copy to clipboard operation
KoExtensions copied to clipboard

is there way to control tooltip text?

Open Qvatra opened this issue 9 years ago • 1 comments

for example I need to format the value in tooltip which in my case is 1.333333333333333 which is not informative at all but take a lot of space..

Qvatra avatar May 21 '15 09:05 Qvatra

Yes there is a way. You need to add option parameter called unitTransform, which is a function applied to the value before shown in the tooltip.

It works with barchart. Check the GraphTests.html file which has the example. Basically if the parent viewModel has a function "valueToLabel" the following will work:

<div id="monthlySales2" data-bind="barchart: carSales,chartOptions:{style:'bar',xcoord:'month',unitTransform:valueToLabel}">

hoonzis avatar Jun 14 '15 21:06 hoonzis