This project is read-only.

Zoom and Pan Chart

May 29, 2013 at 10:13 AM
hi
I wanna pan and zoom my simple chart, i have to mannualy use <toolkit:GestureService.GestureListener> or some Manipulation event ? On Home page there is a listed feafure Zoom and Pan. How can I use this ?

thanks
Coordinator
May 29, 2013 at 11:01 AM
Hi Maroch,

Thanks for supporting sparrow toolkit.

Now i didn't added any Manipulation events to Sparrow Chart. I except this feature should be added within the release.
Even though you could change the zoom and pan by the following properties of Axis.
  1. ZoomCoefficient -> Controls the zooming(range between 0 to 1 and default value is 1)
  2. ZoomOffset ->Controls the panning(range between 0 to 1 and default value is 0)
Below code shows the zoom and pan using slider

<sparrow:SparrowChart Theme="Metro" AxisHeight="30">
      <sparrow:SparrowChart.XAxis>
              <sparrow:LinearXAxis ZoomCoefficient="{Binding Value,ElementName=zoomcoefficient}" ZoomOffset="{Binding Value,ElementName=zoomoffset}"   />
       </sparrow:SparrowChart.XAxis>
        <sparrow:SparrowChart.YAxis>
             <sparrow:LinearYAxis  ZoomCoefficient="{Binding Value,ElementName=zoomcoefficient1}" ZoomOffset="{Binding Value,ElementName=zoomoffset1}"   />
       </sparrow:SparrowChart.YAxis>                
</sparrow:SparrowChart>


and
            <Slider x:Name="zoomoffset" Minimum="0" Maximum="1" />
            <Slider x:Name="zoomoffset1" Minimum="0" Maximum="1" />
            <Slider x:Name="zoomcoefficient" Minimum="0" Maximum="1" Value="1"/>
            <Slider x:Name="zoomcoefficient1" Minimum="0" Maximum="1" Value="1"/>
Please let me know if you need more information on this.

Thanks,
Vinoth Kumar J
May 29, 2013 at 3:35 PM
thx for fast reply
those properties is that what I want.

Im developing windows phone application what i did not write at the beginnig, so I wanna use some pinch or pan gestures on the screen to manipulate Chart.
There is no any event like that on SparrowChart Control to force that funcionality?
I know I can use <toolkit:GestureService.GestureListener> on chart and manipulate ZoomCoefficient and ZoomOffset on my own, but for each chart are the different proportions and scale.

thx
Coordinator
May 29, 2013 at 4:02 PM
Edited May 29, 2013 at 4:14 PM
Hi Maroch,

Now sparrow chart doesn't have any event for pinch and panning. I have working on implementing this feature. I will let you know once its implemented.

also i have logged a feature request https://sparrowtoolkit.codeplex.com/workitem/937

Thanks,
Vinoth Kumar J
Aug 14, 2013 at 10:40 AM
i would also love to have a zoom/pan feature (but on wpf/.net4.0).
natually i would use the mousewheel to zoom and the left mousebutton to pan.
ideally zooming supports modifiers to zoom only vertically/horizontally.

i think implementing a simple zoom function in my application is not a big problem, but i don't know how i should implement a mouse pan function that sets the offsets right according to current view...
Dec 13, 2014 at 7:30 PM
Hello.
I have an application for WP8. I wanna zoom out chart, but zoom coef is [0-1]. How can i do this?