Shared Tooltip

Hi,
I have a linear type graph where on the PrimaryXAxis axis I represent Datetime type data while on the PrimaryYAxis axis I represent money type data; On the axis PrimaryYAxis I also added a representation of the volumes through the Axes property,so I activated the sharing property of the tooltip; 
Since I need to format the data that the tooltip needs to display, I use the TooltipRender method but activating the tooltip sharing this displays the duplicate data (I enclose an image and my code).
Where am I wrong?
I also wanted to know if through the TooltipRender method there was a way to dynamically set the tooltip title.
Thank you so much for your help.
Barbara Inzitari

Attachment: MyCode_6b1a73aa.zip

3 Replies

DD Dharanidharan Dharmasivam Syncfusion Team October 4, 2018 04:06 PM UTC

Hi Inzitari, 
 
Greetings from Syncfusion. 
 
We have analyzed your query with attached image and code snippet. Since there are two series and you have enabled shared tooltip, the tooltipRender event triggered will be twice and the given format will be applied to all the series. So, this seems to be duplicated in your end. We have prepared a sample in which we have different format for two series.  
 
Refer the below code snippet to achieve this. 
 
function tooltip(args) { 
        var intl = new ej.base.Internationalization(); 
        var formattedString = intl.formatDate(new Date(args.point.x), { format: 'MMM.dd y HH:mm' }); 
        var formattedNumber = intl.formatNumber(args.point.y, { format: 'c0' }) 
        if (args.series.index === 0) { 
            args.text = formattedString + '<br\> ' + 'Price ' + formattedNumber; 
        } else if (args.series.index === 1) { 
            args.text = formattedString + '<br\> ' + 'Volume ' + formattedNumber; 
        } 
    } 
 
Screenshot:  
 
 
Sample for reference can be find from below link. 
Also, as of now for adding tooltip header dynamically, we have considered your requirement as improvement and this improvement will be available in volume 3 SP1 release which is expected at end of October 2018.  
Regards, 
Dharani. 
 



NI nimue October 5, 2018 02:21 PM UTC

Hi Dharani,
thank you very much for your answer and for the example you sent me, now the shared tooltip works perfectly.
As for the rest, I will wait for the end of October with the new revision.
Barbara Inzitari


DD Dharanidharan Dharmasivam Syncfusion Team October 8, 2018 06:20 AM UTC

Hi Adham, 
 
Most welcome. We will update you once the volume 3 sp 1 release is rolled out for the requested improvement on changing the tooltip header dynamically. 
 
Thanks, 
Dharani. 


Loader.
Up arrow icon