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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SplineSeries with Unusally High Y axis value

Thread ID:

Created:

Updated:

Platform:

Replies:

131245 Jun 30,2017 10:27 AM UTC Jul 4,2017 03:40 AM UTC Xamarin.Android 1
loading
Tags: SfChart
Albert K
Asked On June 30, 2017 10:27 AM UTC

Hi,

Normally with data interval that is spaced at regular intervals the spline chart looks good but when there a big gap between the two data points the automatic Y axis goes haywire.   The biggest value for Y is 53 but when the graph is plotted it hits 600.

Is there a way to fix the issue?




using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Com.Syncfusion.Charts;
using Android.Graphics;
using Android.Util;
using Com.Syncfusion.Charts.Enums;
using Com.Syncfusion.Rangenavigator;
using Java.Util;
namespace ChartSample
{
    [Activity(Label = "ChartSample", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {
        SfChart chart;
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
           
            SetContentView(Resource.Layout.Main);
            LinearLayout layout = new LinearLayout(this);
            layout.Orientation = Android.Widget.Orientation.Vertical;
           
            chart = new SfChart(this);
            chart.LayoutParameters = new ViewGroup.LayoutParams(1000, 1000);
            chart.SetBackgroundColor(Color.White);
            ObservableArrayList data = new ObservableArrayList();
             data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 1, 0).Time, 34));
            data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 1, 10).Time, 34));
            data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 1, 30).Time, 54));
            data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 18, 0).Time, 47));
            data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 18, 10).Time, 32));
            data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 18, 15).Time, 30));
            data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 18, 30).Time, 53));
            data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 18, 50).Time, 56));
            data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 19, 05).Time, 32));
            data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 19, 10).Time, 30));
            data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 19, 15).Time, 53));
            data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 19, 25).Time, 56));
            data.Add(new ChartDataPoint(new GregorianCalendar(2016, 8, 15, 19, 40).Time, 26));
            DateTimeAxis primary = new DateTimeAxis() { IntervalType = DateTimeIntervalType.Minutes, Visibility=Visibility.Visible };
            NumericalAxis secondary = new NumericalAxis() { Visibility = Visibility.Visible };
            chart.PrimaryAxis = primary;
            chart.SecondaryAxis = secondary;
           
            SplineSeries series = new SplineSeries();
            series.TooltipEnabled = true;
            series.DataMarker.ShowMarker = true;
            series.DataSource = data;
            chart.Series.Add(series);
           
            SfDateTimeRangeNavigator rangeNavigator = new SfDateTimeRangeNavigator(this);
            rangeNavigator.LayoutParameters = new ViewGroup.LayoutParams(1000, 400);
            rangeNavigator.Minimum = new GregorianCalendar(2016, 8, 15, 0, 0).Time;
            rangeNavigator.Maximum = new GregorianCalendar(2016, 8, 15, 0, 0).Time;
            rangeNavigator.ViewRangeStart = new GregorianCalendar(2016, 8, 15, 0, 0).Time;
            rangeNavigator.ViewRangeEnd = new GregorianCalendar(2016, 8, 16, 0, 0).Time;

            SfChart contentChart= new SfChart(this)
            {
                PrimaryAxis = new DateTimeAxis() { ShowMajorGridLines = false, Visibility = Visibility.Gone},
                SecondaryAxis = new NumericalAxis() { ShowMajorGridLines = false, Visibility = Visibility.Gone },              
            };
            contentChart.Series.Add(new SplineAreaSeries() { DataSource = data });
            rangeNavigator.Content = contentChart;
            rangeNavigator.RangeChanged += RangeNavigator_RangeChanged;
            layout.AddView(chart);
            layout.AddView(rangeNavigator);
            SetContentView(layout);
        }
        private void RangeNavigator_RangeChanged(object sender, SfDateTimeRangeNavigator.RangeChangedEventArgs e)
        {
            (chart.PrimaryAxis as DateTimeAxis).Minimum = e.P0;
            (chart.PrimaryAxis as DateTimeAxis).Maximum = e.P1;
        }
    }
}


Saravana Pandian Murugan [Syncfusion]
Replied On July 4, 2017 03:40 AM UTC

Hi Albert,

Thanks for your interest in Syncfusion components.

A support incident has been created under your account and we request you to login into our Direct Trac support system for further updates on this issue. Our Direct Trac support system can be accessed from the following link.

Link: https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents  

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.

Warning Icon 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.Close Icon

;