private async Task NavigateToChart (string itemCode, DateTime date, string itemName)
		{
			if (_mainChartView == null)
				_mainChartView = new ChartMainPageView ();

			var canNavigate = false;

			try {
				await _mainChartView.LoadData (itemCode, date, itemName);
				canNavigate = true;
			} catch (Exception ex) {
				await App.ShowError ("Не удалось загрузить данные", ex.Message);
			}

			if (canNavigate) {
				await Navigation.PushAsync (_mainChartView);
			}
		}
		public ChartView (ChartMainPageView mainView)
		{
			Title = "график";

			InitializeComponent ();

		    if (Device.OS == TargetPlatform.iOS)
		    {
                {
                    var btn = new Button() { Text = "Фильтры" };
                    btn.Clicked += (s, e) =>
                    {
                        mainView.IsPresented = !mainView.IsPresented;
                    };
                    Grid.SetRow(btn, 2);
                    grdRoot.Children.Add(btn);
                }
            }

			Padding = Device.OnPlatform (10, 8, 10);

			_repository = ContainerService.Instance.Container.Resolve<IMatrixCacheRepository> ();

			_chart = new SfChart ();
			_firstSeries = new LineSeries ();
			_secondSeries = new LineSeries ();
			_thirdSeries = new LineSeries ();
			_maxSeries = new ColumnSeries ();
			_secondaryAxis = new NumericalAxis () { Minimum = 0 };

			InitControl ();

			BindingContext = new ChartViewModel ();

			MessagingCenter.Subscribe<ChartSettingsViewModel, ChartShowHideSeriesParameter> (this, MessagingCenterKeys.NeedShowHideChartSeriesKey, OnNeedShowHideChart);
		}