Hi,
I want to use a CursorModifier with a TooltipContainerStyle in a SciChartSurface to display a tooltip. I would like to modify the default behavior that places the tooltip to the bottom and right of the cursor, and place the tooltip at bottom center instead.
Is this possible, and if so, how?
We are using SciChart 4.0.2.8024 in our project.
Of course, I can always use the tooltip’s ActualWidth to tweak its Margin accordingly, but I would like to know if there is a simpler solution than that, before I do this.
- SamiAario asked 8 years ago
- last edited 8 years ago
- You must login to post comments
Hi there,
Thanks for your inquiry. Unfortunately, we don’t provide API to change the default tooltip placement. It is possible to change it doing a little overridding though.
So you should override the HandleMasterMouseEvent method, then retrieve the tooltip from ModifierSurface and finally change its position. Please try the following code:
protected override void HandleMasterMouseEvent(Point mousePoint)
{
if (ModifierSurface != null)
{
var tooltip = ModifierSurface.Children.OfType<CursorLabelControl>().FirstOrDefault();
if(tooltip != null)
{
Canvas.SetLeft(tooltip, mousePoint.X - tooltip.ActualWidth/2);
}
}
}
Please let us know if this helps,
Best regards,
Yuriy
- Yuriy Zadereckiy answered 8 years ago
- You must login to post comments
Hello Yuriy,
I have been busy with other things lately, but have not forgotten this issue.
I ended up implementing a fix using my first approach, but since I have now run into some problems with it, I will now try your proposal.
Thank you,
Sami
- SamiAario answered 8 years ago
- You must login to post comments
Please login first to submit.