We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Lineseries doesn't appear correctly

Thread ID:

Created:

Updated:

Platform:

Replies:

129520 Mar 23,2017 07:22 AM Mar 30,2017 12:19 PM Xamarin.Forms 6
loading
Tags: SfChart
Amro
Asked On March 23, 2017 07:22 AM

Hi, I made sfChart in this way:

KpiTwoChart = EmptyLinearChartBuilder(false, 0, from, to, "KpiTwoNoData");

 FastLineSeries kpiTwoSeries = LineSeriesBuilder(Color.Navy);
 KpiTwoChart.Series.Add(kpiTwoSeries);
 kpiTwoSeries.ItemsSource = viewModel.KpiTwoData; //return a collection of data from REST service, Initially this collection is empty and it will be populated when datas                                                                                              arrive from server

implementation of   EmptyLinearChartBuilder
 public SfChart EmptyLinearChartBuilder(bool hasLegend, int TimePeriod, DateTime from, DateTime to, String isVisibileProperty)
        {
            NumericalAxis secondaryAxis = new NumericalAxis
            {
                RangePadding = NumericalPadding.Round,
                Maximum = 110,
                Minimum = -5,
                MajorTickStyle = new ChartAxisTickStyle
                {
                    TickSize = 3
                },
                EdgeLabelsDrawingMode = EdgeLabelsDrawingMode.Shift
            };

            var chart = new SfChart
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                PrimaryAxis = new CategoryAxis
                {
                    MaximumLabels = 3,
                    OpposedPosition = true,
                    LabelPlacement = LabelPlacement.BetweenTicks,
                   LabelStyle = new ChartAxisLabelStyle
                    {
                        LabelsPosition = AxisElementPosition.Inside
                    },
                    EdgeLabelsDrawingMode = EdgeLabelsDrawingMode.Shift,
                    MajorTickStyle = new ChartAxisTickStyle
                    {
                        TickSize = 0
                    },
                    ShowMajorGridLines = false

                },
                SecondaryAxis = secondaryAxis
            };

            if (hasLegend)
            {
                chart.Legend = new ChartLegend();
                chart.Legend.DockPosition = LegendPlacement.Bottom;
                chart.Legend.IconHeight = 20;
                chart.Legend.IconWidth = 20;
                chart.Legend.IsVisible = true;

                chart.Legend.IsIconVisible = true;



            }

            chart.SecondaryAxis.LabelCreated += SecondaryAxis_LabelCreated;

            if (!String.IsNullOrEmpty(isVisibileProperty))
            {
                NumericalStripLine noData = new NumericalStripLine
                {
                    Text = "No Data",
                    Start = -5,
                    Width = 110,
                    FillColor = Color.Transparent
                };
                noData.SetBinding(NumericalStripLine.IsVisibleProperty, new Binding(isVisibileProperty));
                noData.BindingContext = viewModel;
                secondaryAxis.StripLines.Add(noData);

            }

            return chart;
        }

What happen is this, when I load chars for first time it is correctly rendered but if I put application in background and open it again Line series disappear, and when i press button to reload data series appear agian, I couldn't understand wehere is the problem and why this happen, I also try to bind line series with source of data but nothing, The problem appear only on tablet on Android. I hope anyone could help me, thank you.

Parthiban Sundaram [Syncfusion]
Replied On March 24, 2017 02:55 PM

Hi Amro,

Thanks for using Syncfusion products.

If the back button is pressed, the Android activity will be destroyed. Hence when you open it from the background apps, the application will start from initial point (same like closing and opening the application again).

Reference link: https://forums.xamarin.com/discussion/87092/back-button-closes-app-but-not-the-rest-of-the-application

But this should work when you put your application in background by pressing home button. If you are facing issue in this case too, we kindly request you to provide the device/OS details which will be helpful for providing further assistance on this.

Please let us know, if your issue is different from this.

Regards,
Parthiban S


Amro
Replied On March 27, 2017 09:07 AM

Dell venue 8 Android 5.1

Amro
Replied On March 28, 2017 02:47 AM

Lines sometime doesn't appera also at first lounch of application

Saravana Pandian Murugan [Syncfusion]
Replied On March 28, 2017 01:01 PM

Hi Amro,

Thanks for the update.

We kindly request you to confirm whether you put the application in background by pressing the home button. If so, please check whether you are able to reproduce the issue (while clicking home button and resume, application refreshes) in the attached sample.

Regarding "Lines sometime doesn't appear also at first launch of application",

We are unable to reproduce the reported issue at our end and we have prepared a sample as per your requirement. Please update us the modified sample to reproduce the issue which will be helpful for providing further assistance on this.

Sample : http://www.syncfusion.com/downloads/support/forum/129520/ze/ChartSample451750506

Regards,
Saravana Pandian M.


Amro
Replied On March 29, 2017 03:02 AM

I put the application in background by pressing home button, I'm not able to reproduce the issue in the attached sample, Thank you for helping me.

Saravana Pandian Murugan [Syncfusion]
Replied On March 30, 2017 12:19 PM

Hi Amro,

Thanks for your update.

If you are still facing this issue in your application, could you please update us the modified sample with the issue you are facing which will be helpful to assist you further on this and provide you a solution..

Regards,
Saravana Pandian M.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;