Hello,
I'm working with the chart compoonent on latest 19.2.0.47. I want to have custom markers, but I believe that Marker template in the scatter plot is not supported like it is on the Map component.
As an alternative I'm using Chart Annotations as the points. I'd like to trigger events for "mouseover" and "mouseout "
The problem is that these events do not work correctly within the chart. Instead of proper behavior, the "mouseover" event is triggered with every movement of the mouse, and the "mouseout" event is overlooked
To demonstrate this, I made some code to compare the mouse actions for a span (a) inside the chart vs (b) outside the chart. As you can see, (a) is not working as expected, but (b) works just fine.
I also attached the code.
Seems to me like a bug. Any advice is appreciated.
Example of the behavior when moving the mouse over the points:
|
<ChartSeries Visible="true" XName="Latitude" YName="Longitude" Type="ChartSeriesType.Scatter">
<ChartMarker Visible="true" Height="20" Width="20"> </ChartMarker>
</ChartSeries> |
Hello Durga,
Thank you for your quick reply!
Unfortunately the limited customization of just height and width of the marker are not enough for my application.
Ideally what I need is a Marker Template capability, similar to the maps marker template (link).
That way I can customize my markers more than just the shapes currently available.
The primary objective is to achieve event triggers when @onmouseover
and
@onmouseout
for the markers.
Even with the default marker, these mouse events I need are not supported.
But that's where I can workaround this limited marker by using the Chart Annotations as alternative to the markers.
By using the Chart Annotation, I can take advantage of the @onmouseover and @onmouseout events.
But the problem is that these events do not work properly from within the scatter plot.
From outside the scatter plot it works fine, but something about putting it within the scatter plot causes improper event triggering. That's what I proved with the attachment on my original post.
Could you try to reproduce the behavior from my attached code?
I believe the correct behavior would be for the event triggers to behave the same way either inside or outside the chart.
Thank you!
|
protected override bool ShouldRender() {
return false;
} |
Hello Baby,
Thank you for the reply.
I tried adding the code snippet and I confirmed that the "mouseover" and "mouseout" events do work as intended this way.
However there is a side effect.
My extended purpose of using the "mouseover" and "mouseout" events is to update annotations on the chart to highlight the point which was hovered over. By hardcoding "ShouldRender" to false, it blocks the proper updating of the annotations.
Fortunately I've found a workaround for this side effect.
The solution is to keep track of whether the "mouseover" is currently ongoing, and set "ShouldRender" to false only during that period.
I will continue to use this workaround until the volume 3 main release.
Thank you!
Hello Durga,
Thank you so much for the update, I confirmed that it is working as expected now!
Sorin