Xuni User Guide > Xuni Controls > FlexChart > Features > Scrolling |
Scrolling can be done by using the drag gestures on the device. It is enabled as soon as the Scale
property or the DisplayedRange
property of an axis are set.
Auto-scrolling on any axis can be achieved by invoking the ScrollTo()
method. For example, AxisX.ScrollTo(50, Position.Min)
will scroll axis point 50 in a way that it is displayed as the axis' minimum value in the current view of a zoomed in FlexChart.
The following code example demonstrates how to invoke this method. These examples use the sample created in the Zooming section.
C# |
Copy Code |
---|---|
public static FlexChart GetChartControl() { //Create an instance of the Control and set its properties FlexChart chart = new FlexChart(); //Set the datasource FlexChartDataSource ds = new FlexChartDataSource(); chart.ItemsSource = ds.Data; chart.BindingX = "Name"; //Create a new chart series ChartSeries _series = new ChartSeries(chart, "2014 Sales", "Sales"); _series.ChartType = ChartType.Column; chart.Series.Add(_series); // Zooming chart.ZoomMode = ZoomMode.XY; chart.AxisX.Scale = 0.5; chart.AxisY.Scale = 2; //#region Scrolling chart.AxisX.ScrollTo(chart.AxisX.Max, Position.Max); |