JohnC
JohnC

Reputation: 340

Zooming on Silverlight Toolkit charts?

I need to enable zooming on the Silverlight charts I use - at the moment this is Silverlight Toolkit. As far as I've understood the SL Toolkit charts don't support zooming, however I'm looking into implementing this functionality. So far I haven't managed to get far: applying ScaleTransforms to the Series elements doesn't work as expected.

Can anyone provide me with example code on implementing zooming in Silverlight Toolkit?

Upvotes: 3

Views: 1823

Answers (3)

mbcrump
mbcrump

Reputation: 974

Adding to Gergely Orozy comment about Telerik:

You can easily add the Zoom functionality with the following XAML.

<charting:ChartArea.ZoomScrollSettingsX>
    <charting:ZoomScrollSettings ScrollMode="ScrollAndZoom" MinZoomRange="0.005"/>
</charting:ChartArea.ZoomScrollSettingsX>

You can check out a demo by clicking here and the source code is also available on that same tab.

Upvotes: 0

MrDrews
MrDrews

Reputation: 2137

You should take a look at user610173's blog post. Specifically, download the full example code here: http://slchartzoomandpan.codeplex.com/SourceControl/list/changesets Very helpful!

Upvotes: 0

Gergely Orosz
Gergely Orosz

Reputation: 6485

I've previously looked into implementing zooming on the Silverlight Toolkit charts, however failed because of (probably) the following reasons:

  • Silverlight Toolkit charts don't seem to have been designed to be able to extend for zooming. There are no hooks that you could easily attack some zooming logic to, if you want to create zooming on them, you have to go much deeer.
  • The simplest way of implementing zooming is using ScaleTransform and RenderTransform to elements. In case of Silverlight Toolkit you want to apply this to the series. However just calculating the correct ScaleTransform and OffsetTransform are difficult enough
  • When scaling, you don't want everything to scale. If you zoom in 4x on a line series with points on it, you don't want the line to be 4x thicker and the points to be 4x larger. This means that even if you did implement applying the ScaleTransforms and RenderTransforms correctly, all you would get is a magnifying glass, which is still far from ideal.

After a few hours I gave up on adding this kind of support to the SL toolkit charts and instead looked for other components that support zooming and have a decent API to deal with it. These are the components I've found (though I'm sure there's more):

Summing it up, I think the easiest way for you to go it with a component that already has zooming implemented - from my experience it would take a lot of investment to add proper zooming + panning to Silverlight Toolkit charts.

Upvotes: 6

Related Questions