Posted 9 November 2021, 4:16 am EST
I have a chart that show n lines.
By default the tooltip show the value and the description of the line.
I want to change this beahavior. I want to customize it.
The tooltip have to contain other info.
This info are saved in a datasource A (in memory).
The chart’s dataSource contains a subset of information that I retrieve from datasource A (only numeric value that I want to see in the chart).
I see online that it’s possible to customize tooltip with " _fChart_MouseMove" event (see at the end my code, it’s working)
My question is very simple:
How can I retreive the actual row number of chart’s dataSource?
If I have it for me is very simple to obtain this info because i will retrieve data from datasource A (in memory) at the same position.
Thanks Alex
private void _fChart_MouseMove(object sender, MouseEventArgs e)
{ var hitTestInfo = _fChart.HitTest(e.Location); if (hitTestInfo == null) return; if (hitTestInfo.Item != null && hitTestInfo.Distance <= 10) { // custom tooltip _fChart.ToolTip.Content = "Prova"; } else _fChart.ToolTip.Content = ""; }