[Chart] Device coordinates to plot coordinates

Tim Docker tim at dockerz.net
Thu Jul 11 22:08:27 BST 2013


Take a look at the TestPicking example:

https://github.com/timbod7/haskell-chart/blob/master/chart-gtk/tests/TestPicking.hs

This shows a chart in a gtk window, and prints plot coordinates and 
other information when you click on it.

There's not an example, but this will work with stacked layouts also.

Tim


On 11/07/13 19:46, Sacha Sokoloski wrote:
> I have another question related to the last.
>
> I'm continuing to build up more machinery for running animations using 
> Chart and GTK, and one thing which I would like to do is to register 
> mouse clicks from a GTK window, and transfer them into the coordinates 
> of the plot. The principle reason for this, as an example, is that I 
> have some physical system that I'm simulating, and it would be nice to 
> be able to click on the system to set the initial coordinates. It 
> seems like PickFn is somehow the key, but I thought I would ask before 
> I dive into the guts of Chart.
>
> It would also be helpful to be able to do this in the context of a 
> grid renderable, but I'm not sure how possible that would be.
>
> At some point I can also upload my various animation tools, once we 
> figure out a good way to integrate it. I've noticed that Diagrams 
> people also has an 'active' package for running animations, but I'm 
> not sure how to fit it in. Maybe some kind of GTK backend option for 
> animations?
>
> Thanks,
>
>  - Sacha
>
> _______________________________________________
> Chart mailing list
> Chart at projects.haskell.org
> http://projects.haskell.org/cgi-bin/mailman/listinfo/chart




More information about the Chart mailing list