Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
XamDataChart keep zoomed out when source collection changes.
posted

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?

Parents
No Data
Reply
  • 28925
    Offline posted

    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.

Children