This is a migrated thread and some comments may be shown as answers.

Consitent crash using TKDataSource - Xamarin IOS

1 Answer 35 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Melina
Top achievements
Rank 1
Melina asked on 23 Jun 2015, 06:35 PM

Have already submitted this as a bug in the general area.  Thought I would post here for more impact. 

I am exploring the use of the Data source to try to get more performance out of the Chart. But I can only call reload twice. After that it goes into an infinite loop calling the Data source GetSeries, GetPoints, etc.  This is 100% repeatable 

This is the C# wrapper used with Xamarin IOS 

I did a quit modification of the Telerik sample code : TKChart binding with delegate.

public class BindingWithDelegate: ExampleViewController
{
        TKChart chart

    public override void ViewDidLoad ()
    {
        base.ViewDidLoad ();
    
        this.chart = new TKChart (this.ExampleBounds);
        chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
        chart.DataSource = new ChartDataSource ();
        chart.Legend.Hidden = false;
        chart.Legend.Style.Position = TKChartLegendPosition.Top;
        chart.Legend.Container.Stack.Orientation = TKStackLayoutOrientation.Horizontal;
        this.View.AddSubview (chart);
    }

        public override void ViewDidAppear(bool animated) {
            base.ViewDidAppear(animated);
            this.DoReloads(2); // <- this works up to 2. If you put 3 then it all goes away eventually
        }

        private void DoReloads(int count) {
            for (int i = 0; i < count; i++) {
                this.chart.ReloadData();
            }

            // This dialog will never show if the number is 3 or higher.
            new UIAlertView("Reloaded", string.Format("Did reload {0} times", count), null, "Exit", null).Show();
        }

...

There is more of the telerik code that I did not cut and paste.  You can do your own sample and drive it with a button event, etc.  100% repeatable 

If you put console instrumentation in the data source you will see it is being called infinitely.  Crash is probably due to memory consumption

1 Answer, 1 is accepted

Sort by
0
Sophi
Telerik team
answered on 24 Jun 2015, 03:06 PM
Hi Melina,

I confirm that there is an issue in TKChart when calling the reloadData method multiple times. The issue will be addressed in our next release. Check the full answer to your question in your support ticket regarding the same issue

Regards,
Sophi
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Melina
Top achievements
Rank 1
Answers by
Sophi
Telerik team
Share this question
or