Dear all,
I am checking in chart demo sample how to use mvvm to bind the chart to a datasource for the series.
I have seen in the constructor of the viewmodel that an instance of ViewportMnager is created as below :
ViewportManager = new DefaultViewportManager();
Then it is used in the folloying methods :
// Called when the AppendDataCommand is invoked via button click on the view
private void AppendData()
{
var newData = _dataSource.GetRandomWalkSeries(50);
_dataSeries0.Append(newData.XData, newData.YData);
ViewportManager.ZoomExtents();
}
Could you pleas explain what this viewport is doing and what will happen if ZoomExtends() is not called here ?
- sc sc asked 6 years ago
- You must login to post comments
Documentation for the ViewportManager is here.
ViewportManager – Full Control over Axis VisibleRanges and the Viewport
The ViewportManager API provides fine-grained control over the SciChartSurface viewport, allowing you to configure the result of VisibleRange calculations on a per-axis basis, invalidate the chart from a ViewModel and call methods like ZoomExtents() programmatically from a ViewModel.
As for what ViewportManager.ZoomExtents() does, see here.
“Zooms the chart to the extents of the data, plus any X or Y Grow By fraction set on the X and Y Axes”
- Andrew Burnett-Thompson answered 6 years ago
- You must login to post comments
Please login first to submit.