Using XamDataChart 17.1 in C# 7.0 VS 2017
Image:
http://imgur.com/OGb3NYt
Context:
https://hastebin.com/tovumopota
I am having problem with setting zoombar level back to 100% in response to items being added to FlatDataSource. When FlatDataSource rows or columns collection is modified I would like to set zoom level of chart displaying that FlatDataSource back to 100% so that all data from flatdata is displayed on chart.
For that I add my event to FlatDataSource Columns/Rows CollectionChanged event handler. My event has just method call, ResetZoom() on FlatDataSource instance.
What happens when I debug is:
Collection is changed > Event is called > ResetZoom() is called > I see in UI that zoom is back to 100% (chart displays all data on x axis as expected) > (all good so far) > then event is called couple more times and finally zoombar zoom level goes back to previous value (not 100% - not all data is displayed on chart)
Now my question is how to zoom out chart when collections in FlatDataSource (rows,columns, filters etc.) are changed?
Hello Robert,
Thank you for contacting Infragistics. The zoom level does not change when items are added or removed from the view port. You may reset the WindowRect of the chart.
eg.
chart.WindowRect = new Rect(0,0,1,1)
If this doesn't work please provide a complete sample application and attach it to this forum. Let me know if you have any questions regarding this matter.
Hello Michael,
thank you for your reply. Sadly I must say that when setting WindowRect the behavior is exactly the same. At first chart is zoomed out but then it zooms back in. What I would be looking for is specific event that doesn't change things on its own after I manually set zoom level. Event that would need to trigger in response to collection being changed.