- Home
- Forum
- JavaScript - EJ 2
- Show point tooltip programmatically
Show point tooltip programmatically
I need to show Accumulation chart point tooltip programmatically. I need to trigger it from outside of the chart. Is it possible? I didn't find any mention about this in documentation.
|
tooltipRender: (args: IAccTooltipRenderEventArgs) => {
args.text = args.data.pointX;
}, |
|
document.getElementById('load').onclick = () => {
pie.annotations[0].content = "<div style='border: 2px solid red;color:white' id='chart_annotation'>"+ pie.series[0].dataSource[0].x +"</div>";
pie.refresh();
}; |
I have two charts side by side. They are in the vertical orientation with the data scrolling from the bottom to the top. When the mouse enters one chart, I need to programmatically show the tooltip in the other chart. Attached is a screenshot of my requirements.
What are the API functions to call to do this?
Attachment: time_graph_tooltip_9e53d497.zip
Hi Toni,
Greetings from Syncfusion.
When we hover on one chart, the tooltip appears on both the charts by using the chartMouseMove event of the chart. We have created a Javascript application to demonstrate the same. Please find the below stackblitz link for your reference.
Sample link: https://stackblitz.com/edit/8akjry?file=index.js
Code Snippet:
|
chartMouseMove: function(args) { if (args.target.indexOf('ChartAreaBorder') > -1) { var bounds = document.getElementById('charts1').getBoundingClientRect(); mousemoveEvent( document.getElementById('charts1'), args.x, bounds.y + (bounds.height/2), args.x, bounds.y + (bounds.height/2) ); } }, |
Screenshot:
Please let us know, if the above sample meets your requirement. Kindly, revert us if you have any concerns.
Regards,
Swetha
- 5 Replies
- 4 Participants
- Marked answer
-
JB Jirí Blažek
- Sep 21, 2020 12:53 PM UTC
- Apr 12, 2023 11:01 AM UTC