Custom Tooltip with data not plotted

Hi Support
This may have been asked several times I am not able to see a previous entry for this type of issue (Or situation)

JSON Data
{

"Date": "12/31/2021",
"Price": " $3.5",

"Volume": 45000,

"Total Shares": 4500

}

I am doing a line plot with Date and Price but on the tool tip I want to see
All four data points I know I can get Date and Price as ${x} and ${y}
How about the other two data points Volume and Total SHares how can i render those to the Tooltip ?
Do I have to use TootipRender.





3 Replies

BP Baby Palanidurai Syncfusion Team May 16, 2022 12:38 PM UTC

Hi Jawahar,


Greetings from Syncfusion.


We have checked your query. We are having tooltipRender event, in that, you can get the series data source and based on that you can change the tooltip text. Please find the below sample link,

https://stackblitz.com/edit/yrnyof-rvbngu?file=index.ts


Kindly revert us, if you have any concerns.


Regards,

Baby.



JR Jawahar Rajan May 16, 2022 01:28 PM UTC

When I load your example, it is giving an error in the Browser in stackblitz

Error in /turbo_modules/@syncfusion/[email protected]/dist/ej2-charts.umd.min.js (10:158584)
Cannot read properties of undefined (reading 'series')




DG Durga Gopalakrishnan Syncfusion Team May 17, 2022 01:58 PM UTC

Hi Jawahar,


Sorry for the inconvenience caused. We have resolved the reported problem and shared the updated sample link. Please check with below screenshot and sample.


tooltipRender: function (args) {

    args.text =

      args.text.split(':')[0] +

      ':' +

      args.series.dataSource[args.data.pointIndex].y +

      ' ' +

      args.series.dataSource[args.data.pointIndex].volume +

      ' ' +

      args.series.dataSource[args.data.pointIndex].share;

  }



Sample : https://stackblitz.com/edit/yrnyof-vbcbdp


Please revert us if you have any concerns.


Regards,

Durga Gopalakrishnan.


Loader.
Up arrow icon