Hello,
I am having a problem where I want to display the Rollover Modifier only when I click on the selected graph.
For example:
https://demo.scichart.com/javascript-chart-rollovermodifier-tooltips
If I select the Second Lines Series, I want to see the rollover only for that particular graph and not the first one and the third one.
I have tried using charts id’s as a reference to show only one tooltip but it just enables it for all the graphs.
Any help would be kindly appreciated.
- Zino As asked 4 days ago
- You must login to post comments
Hello,
To implement this you would probably need the Series Selection API in combination with a custom Rollover Modifier.
class CustomRolloverModifier extends RolloverModifier {
getIncludedRenderableSeries() {
return super.getIncludedRenderableSeries().filter((rs) => rs.isSelected);
}
}
const rolloverModifier = new CustomRolloverModifier({
showRolloverLine: true,
showTooltip: true,
// ...
});
const seriesSelectionModifier = new SeriesSelectionModifier({
enableSelection: true,
onSelectionChanged: (args: SelectionChangedArgs) => {
args.allSeries.forEach((rs) => {
rolloverModifier.includeSeries(rs, false);
});
rolloverModifier.includeSeries(args.selectedSeries[0], true);
},
});
sciChartSurface.chartModifiers.add(rolloverModifier, seriesSelectionModifier);
Here is a live CodeSandbox Example:
Also consider checking out the Cursor Modifier.
- You must login to post comments
Please login first to submit.