mouse events in JfreeChart - jfreechart

I need a way to distinguish when a mouse event occurs in the chart itself and not in the chartPanel (the plot area).
Thanks

You should be able to use the mouse event from your panel and use ChartMouseEvent.getEntity() to find if your chart is over one of the chart entities. See the api docs for ChartMouseEvent.

Related

Selecting a Range on the X-Axis in Recharts

I'm trying to reproduce the Airline on-time performance crossfilter demo in React. We're using Recharts. One feature is the ability to drag a selection window across a bar chart. Is this possible in Recharts?
Looks like there's an example on the Recharts page for line charts. It involves the chart's mouseMove, mouseDown, and mouseUp event handlers.
I think the op is looking for a slider solution something like this on bizcharts its a very common thing to have on charts and think it will be valuable to have something simular on recharts

Bing map silverlight control change mode of operation.

By default map viewer responds to map click with dragging map around viewer. I'd like to create functionality wher user can click, draw rectangle and map zooms into this rectangle.
Is this supported by map or is there any way to achieve such behavior?
Adding Shapes to bing map
and after adding the shape you can change the zoom level of the map

Silverlight MapLayer right click issue

I am currently developing a Silverlight OOB application using the Bing Map Control, however I have come across an issue I am struggling to resolve. Basically I have three map layers:-
Base Map (bottom layer)
Icon / Pushpin layer (middle layer)
Shape / drawing layer (top layer)
This all works fine, I have put mouse right click functionality on each of my icons (pushpins if you prefer), if I add a map polygon or polyline to the top layer and this item happens to cover the same area as one of my icons in the middle layer I can no longer get any of the mouse events to fire on my icon.
If anyone can think of a way I can pass the mouse operations from my top layer objects to the middle layer objects please let me know.
Many thanks in advance
Set the IsHitTestVisible of your top layer to false. I feel I need to type more text here but there really isn't much more to say.
It's not clear from your question if you need both the shape and the icon to get the mouse event.
If all you need is for the icon to get the event, then switch the order of your layers so Icon layer is on top.
If you need both shape and icon to get the event, then (if you keep your order with shapes on top) you would need to have some way to tell what icons a shape covers. Do you have a parent/child releationship between them? If not, can you create one? If you set up an event on the shape, and set up OnEvent handlers for the icons that listen to the events, then you can have the icons react as well.
If you are more clear about what your situation is, I could post some code that could help.

What is the best way in Silerlight to make areas of a large graphic clickable?

In a Silverlight application I have large images which have flow charts on them.
I need to handle the clicks on specific hotspots of the image where the flow chart boxes are.
Since the flow charts will always be different, the information of where the hotspots has to be dynamic, e.g. in a list of coordinates.
I've found article like this one but don't need the detail of e.g. the outline of countries but just simple rectangle and circle areas.
I've also found articles where they talk about overlaying an HTML image map over the silverlight application, but it has to be easier than this.
What is the best way to handle clicks on specific areas of an image in silverlight?
Place the Image and a Canvas in a Grid so that the Canvas overlays the Image.
Add shapes of appropriate sizes and placed as needed to the canvas. All shapes will a transparent fill and no border, hence the user only sees the Image. On the Canvas MouseDown (or Up events) use OriginalSource to determine which shape generated the click. Use the Tag property of each shape to associate it with some object that represents the flowchart element being mapped.
I found an easy way to do this without a canvas:
How to get the coordinates of an image mouse click in the event handler?

ohlc chart in jfreechart

Is there a way to detect when the mouse goes over a bar in the chart ?
Take a look at ImageMapUtilities. I added mouseover capabilities by drawing custom XYAnnotations over what I wanted the browser to respond to, and specifying the appropriate tooltip/URLs in the annotation.
(the above is particularly useful for a browser)

Resources