Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141001 | Nov 18,2018 08:37 PM UTC | Nov 21,2018 11:22 AM UTC | Xamarin.Forms | 1 |
![]() |
Tags: SfDateTimeRangeNavigator |
Hi,
I tried to work with the the Range Navigator, supplied as an example. However, both the chart and the time range slider are over lapping. I then tried to take a sample from the forum at, https://www.syncfusion.com/forums/128180/how-to-apply-custom-font-to-x-axis-labels-in-datetimerangenavigator and still I see the same problem.
I tried it both on the emulator and on an android phone. Interestingly, the RangeNavigator example on the "Syncfusion Controls Explorer" app, works, as desired.
Environment:
Visual Studio 2017
Emulator : Android
Phone : Android Based
Any help will be appreciated
Below is the Code
1. SamplePage.xaml.cs
using System;
using System.Collections.Generic;
using Syncfusion.SfChart.XForms;
using Xamarin.Forms;
using Syncfusion.RangeNavigator.XForms;
using Xamarin.Forms.Internals;
namespace RangeExample
{
[Preserve(AllMembers = true)]
public partial class SamplePage : ContentPage
{
public SamplePage()
{
InitializeComponent();
((SfChart)RangeNavigator.Content).Series.Clear();
((SfChart)RangeNavigator.Content).Series.Add(new SplineAreaSeries() { ItemsSource = series.ItemsSource, XBindingPath = "XValue", YBindingPath = "YValue" });
}
void nac_RangeChanged(object sender, Syncfusion.RangeNavigator.XForms.RangeChangedEventArgs e)
{
dateTimeAxis.Minimum = e.ViewRangeStartDate;
dateTimeAxis.Maximum = e.ViewRangeEndDate;
}
}
}
2. SamplePage.xaml
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="RangeExample.SamplePage"
xmlns:chart="clr-namespace:Syncfusion.SfChart.XForms;assembly=Syncfusion.SfChart.XForms"
xmlns:local="clr-namespace:RangeExample;assembly=RangeExample"
xmlns:rangenavigator="clr-namespace:Syncfusion.RangeNavigator.XForms;assembly=Syncfusion.SfChart.XForms"
xmlns:sb="clr-namespace:RangeExample;assembly=RangeExample">
VerticalOptions="FillAndExpand">
XBindingPath="XValue" YBindingPath="YValue"/>
XBindingPath="XValue" YBindingPath="YValue" HeightRequest = "150">
3. RangeSelectorViewModel.cs
using System;
using System.Collections.ObjectModel;
using Syncfusion.SfChart.XForms;
using Xamarin.Forms.Internals;
namespace RangeExample
{
[Preserve(AllMembers = true)]
public class RangeSelectorViewModel
{
public ObservableCollection
public RangeSelectorViewModel()
{
DateTimeRangeData = new ObservableCollection
{
new ChartDataPoint(new DateTime(2015, 01, 1), 14),
new ChartDataPoint(new DateTime(2015, 02, 1), 54),
new ChartDataPoint(new DateTime(2015, 03, 1), 23),
new ChartDataPoint(new DateTime(2015, 04, 1), 53),
new ChartDataPoint(new DateTime(2015, 05, 1), 25),
new ChartDataPoint(new DateTime(2015, 06, 1), 32),
new ChartDataPoint(new DateTime(2015, 07, 1), 78),
new ChartDataPoint(new DateTime(2015, 08, 1), 100),
new ChartDataPoint(new DateTime(2015, 09, 1), 55),
new ChartDataPoint(new DateTime(2015, 10, 1), 38),
new ChartDataPoint(new DateTime(2015, 11, 1), 27),
new ChartDataPoint(new DateTime(2015, 12, 1), 56),
new ChartDataPoint(new DateTime(2015, 12, 31), 35)
};
}
}
}
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.
This page will automatically be redirected to the sign-in page in 10 seconds.