Hi there.
I want to handle the double-click event axis in a 3D chart.
Here is my code.
<s3D:SciChart3DSurface x:Name="chartSurface">
<s3D:SciChart3DSurface.YAxis>
<s3D:NumericAxis3D MouseDoubleClick="Axis_MouseDoubleClick" />
</s3D:SciChart3DSurface.YAxis>
</s3D:SciChart3DSurface>
private void Axis_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
//Do something for target axis...
}
but, it doesn’t seem to work.
So I tried to get the Hit object using “VisualTreeHelper.HitTest”, but it also didn’t work.
protected override void OnMouseDoubleClick(MouseButtonEventArgs e)
{
var hitResult = VisualTreeHelper.HitTest(chartSurface, e.GetPosition(this));
var axis = FindParent<NumericAxis3D>(hitResult.VisualHit);
if (axis != null)
{
//Do somthing for target axis...
}
base.OnMouseDoubleClick(e);
}
private static T? FindParent<T>(DependencyObject child) where T : DependencyObject
{
if (child == null) return null;
T? foundParent = null;
var currentParent = VisualTreeHelper.GetParent(child);
do
{
if (currentParent is T)
{
foundParent = (T)currentParent;
break;
}
currentParent = VisualTreeHelper.GetParent(currentParent);
} while (currentParent != null);
return foundParent;
}
It seems to work well in 2D charts.
Can you please tell me the way to handle the mouse event for the axes in a 3d chart?
Thanks.
- nada nada asked 5 months ago
- last edited 5 months ago
- Hello, Thanks for your inquiry. I’ll discuss this with our team and will get back to you as soon as I have an update. Kind regards, Lex, SciChart Technical Support Engineer
- You must login to post comments
Hello,
Hope you are doing well.
We discussed your inquiry.
In SciChart3D, although Axis classes are derived from ContentControl, they aren’t UI elements and do not participate in the VisualTree. The SciChart render Engine draws the 3D Axes Cube as SceneEntities.
Therefore, it is not possible to subscribe to any WPF events.
If you could provide us with more details regarding the desired behavior though, we will discuss this and let you know if any workaround or a new feature is possible.
Kind regards,
Lex,
SciChart Technical Support Engineer
- Lex answered 5 months ago
- You must login to post comments
Hi,
i do have the same issues here.
In 2D Chart we use mouse move over axis to change cursor and mouse click on axis to fire up an axis scaling dialog, dependant on the axis type.
for 2D it looks like this.
Cursor:
Event
Its an absolute must for us to be able to do that for a 3D chart too.
This currently block us to bring the project to a release state.
Are there any ideas or workarounds?
Thanks
- Thomas Satzinger answered 3 months ago
- last edited 3 months ago
- Hi Thomas, Thank you for being so interested in the mentioned feature. As mentioned, we need more details to provide a workaround or approximate time frame. Unfortunately, it looks like some parts of your message are missing. We would appreciate it if you provide us with a more detailed description of the desired behavior. Kind regards, Lex
- You must login to post comments
Hi Lex,
how long would it take to implement such feature.
I guess internally you know about the Axis Position and the transforms applied when eg. Orbiting.
So making the Axis Hittestable shouldnt be too hard i guess.
This would be really a much needed feature.
Kindest regards,
Armin
- Armin Wild answered 3 months ago
- last edited 3 months ago
- Hi Armin, Thanks for your reply. As I’ve mentioned, we need a detailed description of the desired behavior to provide you with either a workaround or an approximate time frame for implementing the new feature. Looking forward to your reply. Kind regards, Lex
- You must login to post comments
Hi Lex,
Axis MouseClick Event / Axis3D Hittestability:
We need to be able to detect mouse clicks in the x/y/z axis area
Crosshair:
I’ve provided a code sample via email for reference. The implementation should replicate the exact behavior of the 2D CrosshairModifier for the SciChartSurface 3D version:
On enabling the Modifier, the Crosshair should appear at the midpoint of the available data range. Control should be possible via: Keyboard: Left/Right arrow keys move along the X-Axis, Up/Down along the Z-Axis. Mouse: Click or scroll interaction. The Chart should fire Events when moving the crosshair, containing Infos like series Name, x/y/z values.
Additional Tools:
Extended Crosshair – Mode 1:
Clicking on the chart adds a single line at the clicked DataPoint.
A second click adds another line at a different DataPoint.
Events should be triggered for each line addition, providing coordinates and data values.
Moving like described in Crosshair, along with the Events, must be possible.
Extended Crosshair – Mode 2:
The first click adds a center line, and the second click specifies a Delta to the first line.
Beginning from the centre (1st lines) there has to be a Chance to add multiple lines left and Right to the centre in the given distance, e.g. 3 lines left of the centre, 3 lines Right of the centre, all with the measured Delta.
Events should trigger on both clicks, reporting coordinates and data values for the center line (first click) and delta (second click).
Both tools should support mousewheel control with two modes:
Position Mode: Mousewheel scroll moves the entire ChartModifier along the X-Axis.
Distance Mode: Mousewheel scroll adjusts the delta between lines.
Switching between modes should be possible via a middle mouse button click.
Let me know if further clarification is needed!
Kindest regards,
Armin
- Armin Wild answered 3 months ago
- last edited 3 months ago
- Hi Armin, Thank you for the provided details. I’m forwarding this to our team for further discussion. Kind regards, Lex
- You must login to post comments
Hi everyone,
We discussed the provided details and logged the requested feature in our tracking system for further investigation.
Unfortunately, adding this feature requires reworking SciChart Axis3D API, that’s why it can take time to implement it.
Once this feature request is prioritized based on its relevance and the number of related requests, our team will consider it for one of the future SciChart versions.
Kind regards,
Lex,
SciChart Technical Support Engineer
- Lex answered 2 months ago
- You must login to post comments
Please login first to submit.