Adding panning (or translating) functionality to C1Chart can be done in 2 easy steps:
1. On the axis you wish to pan, set the Scale property to the percent (<1) of the data points to be seen in one snapshot. In this case, we want to see 20% of the X-axis in one snapshot.
2. Add a TranslateAction to the Actions collection. This turns on the translate action (you could add zooming or scaling actions as well).
Here's the full XAML:
<c1chart:C1Chart Name="c1Chart1" ChartType="Line" Palette="Metro"> <c1chart:C1Chart.Actions> <c1chart:TranslateAction /> </c1chart:C1Chart.Actions> <c1chart:C1Chart.View> <c1chart:ChartView> <c1chart:ChartView.AxisX> <c1chart:Axis Scale=".2" /> </c1chart:ChartView.AxisX> </c1chart:ChartView> </c1chart:C1Chart.View> </c1chart:C1Chart>
Here's the code to do the same:
c1Chart1.View.AxisX.Scale = 0.2; c1Chart1.Actions.Add(new C1.Phone.Chart.TranslateAction());
Of course this works best if you have a LOT of data to display (who doesn’t?). Run the app and you should be able to pan across the axis by touching and sliding your finger.
The attached sample was built using version WP7.1 and C1Chart which you can download from here.